Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(700)

Issue 6247048: i#239: Synch with all other threads on fork. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by Reid Kleckner (google)
Modified:
11 years, 11 months ago
Reviewers:
bruening
CC:
dynamorio-devs_googlegroups.com
Base URL:
https://dynamorio.googlecode.com/svn/trunk
Visibility:
Public.

Description

i#239: Synch with all other threads on fork. This helps to ensure that all DR locks are released when we begin execution in the child. If the app is spawning threads and forking concurrently, then we may fail to synch with a recently spawned thread due to issue 26, and so we may still have possible leaks and deadlocks in the child process.

Patch Set 1 : touch up diff #

Total comments: 23

Patch Set 2 : mostly comment tweaks #

Total comments: 4

Patch Set 3 : comment updates #

Patch Set 4 : don't trigger issue 26 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+258 lines, -10 lines) Patch
M core/dynamo.c View 1 1 chunk +0 lines, -6 lines 0 comments Download
M core/linux/os.c View 1 2 3 5 chunks +80 lines, -0 lines 0 comments Download
M core/linux/os_private.h View 1 chunk +5 lines, -0 lines 0 comments Download
M core/linux/signal.c View 1 2 3 3 chunks +15 lines, -3 lines 2 comments Download
M core/synch.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M core/utils.c View 1 chunk +3 lines, -0 lines 0 comments Download
M suite/tests/CMakeLists.txt View 1 2 3 1 chunk +1 line, -0 lines 1 comment Download
A suite/tests/pthreads/pthreads_fork.c View 1 2 3 1 chunk +149 lines, -0 lines 0 comments Download
A suite/tests/pthreads/pthreads_fork.expect View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 9
Reid Kleckner (google)
I measured this change on make inside DR's source tree and it had ~0.8% perf ...
11 years, 11 months ago (2012-05-25 18:40:24 UTC) #1
bruening
http://codereview.appspot.com/6247048/diff/7001/core/linux/os.c File core/linux/os.c (right): http://codereview.appspot.com/6247048/diff/7001/core/linux/os.c#newcode2132 core/linux/os.c:2132: if (!synch_with_all_threads(THREAD_SYNCH_SUSPENDED_VALID_MCONTEXT_OR_NO_XFER, looks right http://codereview.appspot.com/6247048/diff/7001/core/linux/os.c#newcode2135 core/linux/os.c:2135: THREAD_SYNCH_NO_LOCKS_NO_XFER, you've got ...
11 years, 11 months ago (2012-05-29 17:27:19 UTC) #2
Reid Kleckner (google)
New diff. http://codereview.appspot.com/6247048/diff/7001/core/linux/os.c File core/linux/os.c (right): http://codereview.appspot.com/6247048/diff/7001/core/linux/os.c#newcode2135 core/linux/os.c:2135: THREAD_SYNCH_NO_LOCKS_NO_XFER, On 2012/05/29 17:27:19, bruening wrote: > ...
11 years, 11 months ago (2012-05-29 18:36:57 UTC) #3
bruening
LGTM w/ comments on comments http://codereview.appspot.com/6247048/diff/7001/core/dynamo.c File core/dynamo.c (right): http://codereview.appspot.com/6247048/diff/7001/core/dynamo.c#newcode756 core/dynamo.c:756: * We can't call ...
11 years, 11 months ago (2012-05-30 13:53:59 UTC) #4
Reid Kleckner (google)
I uploaded the last comment changes, and I'll commit soon. http://codereview.appspot.com/6247048/diff/7001/core/dynamo.c File core/dynamo.c (right): http://codereview.appspot.com/6247048/diff/7001/core/dynamo.c#newcode756 ...
11 years, 11 months ago (2012-05-30 14:40:56 UTC) #5
Reid Kleckner (google)
Hm, the pthreads_fork test fails if I run it in a loop and load my ...
11 years, 11 months ago (2012-05-30 15:33:14 UTC) #6
Reid Kleckner (google)
The test is stable now, but we still have a problem with concurrently spawning threads ...
11 years, 11 months ago (2012-05-30 17:34:09 UTC) #7
bruening
LGTM w/ one question http://codereview.appspot.com/6247048/diff/15001/core/linux/signal.c File core/linux/signal.c (right): http://codereview.appspot.com/6247048/diff/15001/core/linux/signal.c#newcode3805 core/linux/signal.c:3805: dcontext == NULL && if ...
11 years, 11 months ago (2012-05-30 22:04:52 UTC) #8
Reid Kleckner (google)
11 years, 11 months ago (2012-06-04 15:08:46 UTC) #9
Committing after suite.

http://codereview.appspot.com/6247048/diff/15001/core/linux/signal.c
File core/linux/signal.c (right):

http://codereview.appspot.com/6247048/diff/15001/core/linux/signal.c#newcode3805
core/linux/signal.c:3805: dcontext == NULL &&
On 2012/05/30 22:04:52, bruening wrote:
> if you add this can't you remove the thread_lookup check?

Sure.  The only way that might break is if there was a native thread that had no
dcontext that was present in all_threads but we wanted it to remain native when
we took over.  I can't imagine why we'd want that.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b