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

Issue 2165493002: Subzero: Fixed deadlock with _start but no globals (Closed)

Created:
4 years, 5 months ago by tlively
Modified:
4 years, 5 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Subzero: Fixed deadlock when _start is first function It was previously the case that instrumentStart in ASanInstrumentation would block until instrumentGlobals had completed. This was because instrumentStart depends on the global redzones having been inserted. However, instrumentGlobals was not called until the first function was popped off the emit queue, and when _start was the first function, it was not placed on the emit queue until after it had been instrumented and lowered. instrumentStart was waiting for instrumentGlobals, which could not happen until instrumentStart completed. BUG=https://bugs.chromium.org/p/nativeclient/issues/detail?id=4374 R=kschimpf@google.com, stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=2c9992a596475c09234ee69e66b5ae715ca33124

Patch Set 1 #

Total comments: 9

Patch Set 2 : Added condition variable and moved synchronization to Instrumentation #

Total comments: 6

Patch Set 3 : Fixes, added destructor to please minimal build linker #

Patch Set 4 : Moved an include to the proper file #

Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -15 lines) Patch
M src/IceASanInstrumentation.h View 1 2 3 3 chunks +1 line, -7 lines 0 comments Download
M src/IceASanInstrumentation.cpp View 1 3 chunks +3 lines, -8 lines 0 comments Download
M src/IceGlobalContext.h View 1 2 2 chunks +6 lines, -0 lines 0 comments Download
M src/IceInstrumentation.h View 1 2 3 3 chunks +10 lines, -0 lines 0 comments Download
M src/IceInstrumentation.cpp View 1 2 1 chunk +14 lines, -0 lines 0 comments Download
A tests_lit/asan_tests/no_globals.ll View 1 1 chunk +19 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (4 generated)
tlively
https://codereview.chromium.org/2165493002/diff/1/src/IceASanInstrumentation.cpp File src/IceASanInstrumentation.cpp (right): https://codereview.chromium.org/2165493002/diff/1/src/IceASanInstrumentation.cpp#newcode339 src/IceASanInstrumentation.cpp:339: while (!Ctx->getGlobalsReceived()) { This spinning could be replaced by ...
4 years, 5 months ago (2016-07-19 07:59:54 UTC) #2
Jim Stichnoth
Also, please beef up the CL description to explain the deadlock scenario. https://codereview.chromium.org/2165493002/diff/1/src/IceASanInstrumentation.cpp File src/IceASanInstrumentation.cpp ...
4 years, 5 months ago (2016-07-19 14:04:13 UTC) #3
tlively
https://codereview.chromium.org/2165493002/diff/1/src/IceASanInstrumentation.cpp File src/IceASanInstrumentation.cpp (right): https://codereview.chromium.org/2165493002/diff/1/src/IceASanInstrumentation.cpp#newcode77 src/IceASanInstrumentation.cpp:77: GlobalsMutex.lock(); On 2016/07/19 14:04:13, stichnot wrote: > Can you ...
4 years, 5 months ago (2016-07-19 22:27:04 UTC) #4
Jim Stichnoth
https://codereview.chromium.org/2165493002/diff/20001/src/IceGlobalContext.h File src/IceGlobalContext.h (right): https://codereview.chromium.org/2165493002/diff/20001/src/IceGlobalContext.h#newcode619 src/IceGlobalContext.h:619: if (!BuildDefs::minimal() && Instrumentor != NULL) nullptr https://codereview.chromium.org/2165493002/diff/20001/src/IceInstrumentation.cpp File ...
4 years, 5 months ago (2016-07-19 22:39:00 UTC) #7
tlively
https://codereview.chromium.org/2165493002/diff/20001/src/IceGlobalContext.h File src/IceGlobalContext.h (right): https://codereview.chromium.org/2165493002/diff/20001/src/IceGlobalContext.h#newcode619 src/IceGlobalContext.h:619: if (!BuildDefs::minimal() && Instrumentor != NULL) On 2016/07/19 22:39:00, ...
4 years, 5 months ago (2016-07-19 23:20:14 UTC) #8
Karl
lgtm
4 years, 5 months ago (2016-07-20 17:19:09 UTC) #9
Jim Stichnoth
lgtm
4 years, 5 months ago (2016-07-20 17:36:11 UTC) #10
tlively
4 years, 5 months ago (2016-07-20 18:19:22 UTC) #12
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
2c9992a596475c09234ee69e66b5ae715ca33124 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698