zig icon indicating copy to clipboard operation
zig copied to clipboard

Update the thread sanitizer from llvm 17.0.3

Open IntegratedQuantum opened this issue 2 years ago • 5 comments

Fixes #15241

Now, since you shouldn't trust me, someone from the team should probably redo the steps I took:

  1. I removed all the source files from lib/tsan lib/tsan/interception lib/tsan/sanitizer_common lib/tsan/ubsan
  2. I downloaded the source code of the llvm 17.0.3 release from their github page.
  3. I copied all source files from llvm-project/compiler-rt/lib/tsan/rtl to lib/tsan
  4. I copied the files ubsan_flags.h, ubsan_flags.inc, ubsan_init.h and ubsan_platform.h from llvm-project/compiler-rt/lib/ubsan to lib/tsan/ubsan
  5. I copied all source files from llvm-project/compiler-rt/lib/sanitizer_common to lib/tsan/sanitizer_common
  6. I copied all source files from llvm-project/compiler-rt/lib/interception to lib/tsan/interception
  7. I modified src/libtsan.zig to accomodate for all the file changes.

I tested it on a project of mine, were it runs fine and it even pointed out a bunch of data races.

IntegratedQuantum avatar Oct 24 '23 17:10 IntegratedQuantum

Nice work, thank you!

andrewrk avatar Oct 24 '23 18:10 andrewrk

Any status update with this?

adrian4096 avatar Nov 26 '23 17:11 adrian4096

Any status update with this?

At least from my side it's all done and it appears to be all working. I'm also just waiting.

IntegratedQuantum avatar Nov 27 '23 22:11 IntegratedQuantum

Thanks for pointing out this issue.

IntegratedQuantum avatar Nov 30 '23 10:11 IntegratedQuantum

Did a compiler bootstrap with llvm with this PR rebased onto master and confirmed it worked. Without this pr couldn't get -fsanitize-thread to work as it was erroring on missing crypt.h. Is there anything blocking this from being merged?

jordanisaacs avatar Dec 20 '23 07:12 jordanisaacs

Closing in favor of #18505.

Thanks, it was useful to reference your work.

andrewrk avatar Jan 10 '24 08:01 andrewrk