Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(502)

Issue 2576003002: Add the ability to defer the initialization of the SyzyAsan crash reporter. (Closed)

Created:
4 years ago by Sébastien Marchand
Modified:
3 years, 11 months ago
Reviewers:
chrisha
CC:
syzygy-changes_googlegroups.com
Target Ref:
refs/heads/master
Project:
syzygy
Visibility:
Public.

Description

Add the ability to defer the initialization of the SyzyAsan crash reporter. This CL adds a new flag to the SYZYASAN_RTL_OPTIONS (which can also be set at instrumentation time) to delay the initialization of the crash reporter. By default the runtime try to initialize its crash reporter (e.g. connecting to the Crashpad one) during its initialization (i.e. when the SyzyAsan runtime get loaded), but in some cases this can fail because the crash reporter that we try to connect to isn't ready yet. This function adds a new function that the instrumented process can call once it has initialized his crash reporter. We don't need this for Chrome because by the time we load the instrumented chrome.dll (which loads syzyasan_rtl.dll) we know that the Crashpad reporter has been initialized so we can connect to it directly, but this doesn't work when instrumenting a .exe file, so if it want to use the advanced crash reporting it'll need to use this new flag at compile time and to manually call the asan_InitializeCrashHandler function once its crash reporter is ready. * By 'crash reporter' I mean Crashpad. BUG=chromium:557759 Review-Url: https://codereview.chromium.org/2576003002 Committed: https://github.com/google/syzygy/commit/666a753011a7f9f2f10adadf6ae5e65d8b6af7b4

Patch Set 1 #

Patch Set 2 : Add an entry point to reinitialize the crash reporter. #

Total comments: 2

Patch Set 3 : Add a flag to control the defer initialization. #

Patch Set 4 : Add a flag to control the defer initialization. #

Patch Set 5 : Add a flag to control the defer initialization. #

Patch Set 6 : Rebase #

Patch Set 7 : Test. #

Patch Set 8 : Fixes #

Patch Set 9 : x64 def file. #

Total comments: 6

Patch Set 10 : Add comments. #

Total comments: 6

Patch Set 11 : Fix comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+317 lines, -210 lines) Patch
M syzygy/agent/asan/error_info.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M syzygy/agent/asan/gen/system_interceptors.def View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M syzygy/agent/asan/rtl_impl.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +24 lines, -1 line 0 comments Download
M syzygy/agent/asan/rtl_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M syzygy/agent/asan/rtl_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 4 chunks +30 lines, -1 line 0 comments Download
M syzygy/agent/asan/runtime.h View 1 2 3 4 5 6 7 8 9 3 chunks +17 lines, -0 lines 0 comments Download
M syzygy/agent/asan/runtime.cc View 1 2 3 4 5 6 7 8 9 5 chunks +42 lines, -30 lines 0 comments Download
M syzygy/agent/asan/system_interceptors_x64.def View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M syzygy/agent/asan/syzyasan_rtl.def.template View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M syzygy/agent/asan/unittest_util.h View 1 2 3 4 5 6 7 8 9 1 chunk +164 lines, -170 lines 0 comments Download
M syzygy/common/asan_parameters.h View 1 2 5 chunks +9 lines, -4 lines 0 comments Download
M syzygy/common/asan_parameters.cc View 1 2 4 chunks +8 lines, -1 line 0 comments Download
M syzygy/common/asan_parameters_unittest.cc View 1 2 4 chunks +8 lines, -1 line 0 comments Download
M syzygy/instrument/transforms/asan_transform.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 17 (6 generated)
Sébastien Marchand
Here's my attempt at making SyzyAsan work with setup.exe (we need a deferred initialization of ...
4 years ago (2016-12-14 22:56:26 UTC) #2
chrisha
I'd prefer this in conjunction with a flag. The presence of the flag in the ...
4 years ago (2016-12-15 18:48:49 UTC) #3
Sébastien Marchand
Wdyt of this approach? unittests still don't work
4 years ago (2016-12-15 22:20:21 UTC) #4
Sébastien Marchand
PTAL.
3 years, 11 months ago (2017-01-10 21:49:20 UTC) #5
chrisha
https://codereview.chromium.org/2576003002/diff/160001/syzygy/agent/asan/rtl_impl.h File syzygy/agent/asan/rtl_impl.h (right): https://codereview.chromium.org/2576003002/diff/160001/syzygy/agent/asan/rtl_impl.h#newcode117 syzygy/agent/asan/rtl_impl.h:117: More comments here please. Exactly what this does, how ...
3 years, 11 months ago (2017-01-11 18:57:29 UTC) #6
Sébastien Marchand
Added more comments and updated the CL description. https://codereview.chromium.org/2576003002/diff/160001/syzygy/agent/asan/rtl_impl.h File syzygy/agent/asan/rtl_impl.h (right): https://codereview.chromium.org/2576003002/diff/160001/syzygy/agent/asan/rtl_impl.h#newcode117 syzygy/agent/asan/rtl_impl.h:117: On ...
3 years, 11 months ago (2017-01-11 21:38:08 UTC) #8
Sébastien Marchand
ping?
3 years, 11 months ago (2017-01-13 18:04:58 UTC) #9
chrisha
lgtm! https://codereview.chromium.org/2576003002/diff/180001/syzygy/agent/asan/rtl_impl.h File syzygy/agent/asan/rtl_impl.h (right): https://codereview.chromium.org/2576003002/diff/180001/syzygy/agent/asan/rtl_impl.h#newcode116 syzygy/agent/asan/rtl_impl.h:116: // This functions allows to manually initialize the ...
3 years, 11 months ago (2017-01-13 18:16:26 UTC) #10
Sébastien Marchand
Thanks, committing, I've also replaced handler by reporter in the comments to be more consistent. ...
3 years, 11 months ago (2017-01-13 20:56:02 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2576003002/200001
3 years, 11 months ago (2017-01-13 20:56:15 UTC) #14
commit-bot: I haz the power
3 years, 11 months ago (2017-01-13 21:39:18 UTC) #17
Message was sent while issue was closed.
Committed patchset #11 (id:200001) as
https://github.com/google/syzygy/commit/666a753011a7f9f2f10adadf6ae5e65d8b6af7b4

Powered by Google App Engine
This is Rietveld 408576698