Fixes b/242869837
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| compiler-rt/test/tsan/fd_location_closed.cpp | ||
|---|---|---|
| 9 | This barrier won't really ensure any particular ordering of the racing events, right? | |
update the test
| compiler-rt/test/tsan/fd_location_closed.cpp | ||
|---|---|---|
| 9 | We need race between read and close, and then, when we start reporting, another close on the read thread must destroy the fd | |
| compiler-rt/test/tsan/fd_location_closed.cpp | ||
|---|---|---|
| 9 | WARNING: ThreadSanitizer: data race (pid=4113552)
  Write of size 8 at 0x7bb000000060 by thread T2:
    #0 close compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1769:3 (fd_location_closed.cpp.tmp+0x58665)
    #1 Thread(void*) compiler-rt/test/tsan/fd_location_closed.cpp:11:3 (fd_location_closed.cpp.tmp+0xd59a5)
  Previous read of size 8 at 0x7bb000000060 by thread T1:
    #0 read compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_common_interceptors.inc:1091:3 (fd_location_closed.cpp.tmp+0x5e684)
    #1 Thread(void*) compiler-rt/test/tsan/fd_location_closed.cpp:9:3 (fd_location_closed.cpp.tmp+0xd5992)
  Location is file descriptor 3 destroyed by thread T1 at:
    #0 close compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1769:3 (fd_location_closed.cpp.tmp+0x58665)
    #1 Thread(void*) compiler-rt/test/tsan/fd_location_closed.cpp:11:3 (fd_location_closed.cpp.tmp+0xd59a5)
  Thread T2 (tid=4113555, running) created by main thread at:
    #0 pthread_create compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1022:3 (fd_location_closed.cpp.tmp+0x537bd)
    #1 main compiler-rt/test/tsan/fd_location_closed.cpp:20:3 (fd_location_closed.cpp.tmp+0xd5a37)
  Thread T1 (tid=4113554, finished) created by main thread at:
    #0 pthread_create compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1022:3 (fd_location_closed.cpp.tmp+0x537bd)
    #1 main compiler-rt/test/tsan/fd_location_closed.cpp:19:3 (fd_location_closed.cpp.tmp+0xd5a22) | |
I see @dblaikie already reverted this but in case you want some output to look at here's one of Linaro's failing builds: https://lab.llvm.org/buildbot/#/builders/179/builds/4279
This barrier won't really ensure any particular ordering of the racing events, right?
Such tests w/o ordering used to be flaky. We generally create only 2 thread and fix the needed order of events with the barrier.