This is an archive of the discontinued LLVM Phabricator instance.

tsan: fix signal handling during stop-the-world
AbandonedPublic

Authored by dvyukov on Feb 18 2015, 5:57 AM.

Details

Reviewers
earthdok
Summary

Long story short: stop-the-world briefly resets SIGSEGV handler to SIG_DFL. This breaks programs that handle and continue after SIGSEGV (namely JVM). See the test and comments for details.

Diff Detail

Event Timeline

dvyukov updated this revision to Diff 20166.Feb 18 2015, 5:57 AM
dvyukov retitled this revision from to tsan: fix signal handling during stop-the-world.
dvyukov updated this object.
dvyukov edited the test plan for this revision. (Show Details)
dvyukov added a reviewer: earthdok.
dvyukov added a subscriber: Unknown Object (MLST).
earthdok added inline comments.Feb 18 2015, 6:33 AM
lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
253

Why did you remove this?

268

We shouldn't ever run TracerThreadDieCallback() from other threads. It wouldn't work anyway.

I think TracerThreadDieCallback() should check that internal_getpid() == stoptheworld_tracer_pid. If not, just call the old callback.

earthdok edited edge metadata.Feb 18 2015, 6:33 AM

The general approach LGTM

dvyukov added inline comments.Feb 18 2015, 6:42 AM
lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
253

I see no reason for it to be here. We are going to die anyway, so why bother blocking signals?
If there is a reason for it to be here, then we need to comment this line.

268

Agree.
But this is a separate issue, let's fix it separately.

Committed revision 229678.

dvyukov abandoned this revision.Apr 15 2021, 1:20 AM