[PATCH] D25858: [tsan][llvm] Implement the function attribute to disable TSan checking at run time

Anna Zaks via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 12:12:55 PDT 2016


zaks.anna added inline comments.


================
Comment at: lib/Transforms/Instrumentation/ThreadSanitizer.cpp:410
+  }
+  for (auto NoRetCallInst : NoRetCalls) {
+    IRBuilder<> IRB(NoRetCallInst);
----------------
dvyukov wrote:
> Do you have any particular use case for noreturn calls? I don't think it will work as expected. We don't return from that function, not from this function. Consider that we longjmp solely within this function, we will still exit from this function and call TsanIgnoreEnd on normal return path.
> Moreover, most of the functions that recursively call noreturn function are not noreturn themselves. So if we call a function that recursively calls longjmp, we will fail to call TsanIgnoreEnd.
> 
One of my reduced test cases was calling 'exit()' inside dealloc, which lead to the runtime warning about mismatched ignores. This code fixes that case. Given that, I do not think it's likely that anyone would call a no-return function from dealloc.

I see that this fix will not work in all cases as you pointed out. Would you prefer removing it altogether or adding a comment explaining that it won't work in general?


https://reviews.llvm.org/D25858





More information about the llvm-commits mailing list