2

I am testing some code using Google's tsan thread sanitizer. Tsan is telling me that I have a race condition in a particular function, but it is not clear to me from looking at the output what the problem is. Is it possible to set a breakpoint in gdb to break on the spot where tsan generates the warning?

Steven Scott
  • 481
  • 3
  • 14
  • 1
    Have you tried putting a breakpoint on `__tsan::PrintReport`? – ssbssa Jun 05 '20 at 13:44
  • Thanks, that's just the sort of thing I was looking for. In my case the breakpoint never hit. I tried looking for PrintReport in the tsan source code (https://github.com/google/sanitizers/wiki/ThreadSanitizerDevelopment), but could not find it. – Steven Scott Jun 06 '20 at 22:48
  • 1
    You can find PrintReport [here](https://github.com/llvm/llvm-project/blob/7a6461fcc2ed8e28c43993c561721af0bbe97f3a/compiler-rt/lib/tsan/rtl/tsan_report.cpp#L316). – ssbssa Jun 06 '20 at 23:52

0 Answers0