[PATCH] D39935: [tsan] Fix signal chaining

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 12:48:29 PST 2017


vitalybuka added inline comments.


================
Comment at: compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:2309
+    uptr cb = (uptr)old->sigaction;
+    if (cb == (uptr)rtl_sigaction || cb == (uptr)rtl_sighandler) {
+      internal_memcpy(old, &old_stored, sizeof(*old));
----------------
dvyukov wrote:
> I think we should at least zero old. Otherwise there is no way to distinguish when it's filled and when it's uninit garbage.
if (res != 0) it's OK to expect garbage there
if (res == 0) old contains whatever was installed without interceptor, and this is the point of the patch, to get Deadly Signal handler.
We install "Deadly Signal" handler using real sigaction to avoid "allow_user_segv_handler" flag check in interceptor.


https://reviews.llvm.org/D39935





More information about the llvm-commits mailing list