[PATCH] tsan: fix signal handling during stop-the-world

Dmitry Vyukov dvyukov at google.com
Wed Feb 18 06:42:04 PST 2015


================
Comment at: lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:253
@@ -252,3 @@
-    new_sigaction.sa_flags = SA_ONSTACK | SA_SIGINFO;
-    internal_sigfillset(&new_sigaction.sa_mask);
-    internal_sigaction_norestorer(kUnblockedSignals[signal_index],
----------------
earthdok wrote:
> Why did you remove this?
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.


================
Comment at: lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:268
@@ -268,1 +267,3 @@
+  // it can call KillAllThreads on the destroyed variable.
+  SetDieCallback(old_die_callback);
   thread_suspender_instance = NULL;
----------------
earthdok wrote:
> 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.
Agree.
But this is a separate issue, let's fix it separately.

http://reviews.llvm.org/D7722

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list