[PATCH] StopTheWorld in sanitizer_common (first commit)

Reid Kleckner rnk at google.com
Tue Mar 12 11:06:17 PDT 2013


  Is there a wiki page or design doc explaining why you have to use ptrace instead of regular signals + sigcxt?  Too many ways for the app to block signals that can't be intercepted?


================
Comment at: lib/sanitizer_common/sanitizer_stoptheworld_linux.cc:290
@@ +289,3 @@
+                          (char *)&a_local_variable - kReservedStackSize,
+                          CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_UNTRACED,
+                          &tracer_thread_argument, 0, 0, 0);
----------------
You could use CLONE_SETTLS to make sure you get a separate errno.

Also, consider that any of the calls below may trigger _dl_runtime_resolve in the loader, which will expect TLS to be sane.  This could be a big source of bugs.

We used to have test cases in DynamoRIO that used raw clone, and you have to be super careful when you do it.


http://llvm-reviews.chandlerc.com/D469



More information about the llvm-commits mailing list