-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Open
Description
I'm seeing this race failure in two unrelated PRs during the validation_chainstate_tests/chainstate_update_tip case:
https://cirrus-ci.com/task/5125235994263552?logs=ci#L4140 from #22702
https://cirrus-ci.com/task/5269464468946944?logs=ci#L4142 from #21206
test/validation_chainstate_tests.cpp(83): Entering test case "chainstate_update_tip"
...
[Makefile:18480: test/validation_chainstate_tests.cpp.test] Error 1
...
WARNING: ThreadSanitizer: data race (pid=23076)
Read of size 8 at 0x7f23d669c6d0 by main thread:
#0 std::__1::ios_base::width() const /usr/lib/llvm-12/bin/../include/c++/v1/ios:523:12 (test_bitcoin+0x17826c)
...
Location is global 'std::__1::cout' of size 160 at 0x7f23d669c6b0 (libc++.so.1+0x0000000cd6d0)
...
SUMMARY: ThreadSanitizer: data race /usr/lib/llvm-12/bin/../include/c++/v1/ios:523:12 in std::__1::ios_base::width() const
I'm not sure if this is a real bug or spurious, but I did work around a similar problem previously (in #15719) by adding a suppression:
bitcoin/test/sanitizer_suppressions/tsan
Lines 33 to 40 in 81be7ff
| # Disable spurious error about std::cout. | |
| # data race /usr/lib/llvm-10/bin/../include/c++/v1/ios:522:12 in std::__1::ios_base::width() const | |
| # Location is global 'std::__1::cout' of size 160 at 0x7f492785e270 (libc++.so.1+0x0000000c0290) | |
| # https://travis-ci.org/github/bitcoin/bitcoin/jobs/695004018 | |
| # | |
| # Uses of std::cout are guaranteed thread safe by the c++ standard | |
| # https://stackoverflow.com/questions/50322790/thread-safety-and-piping-to-streams | |
| race:std::__1::ios_base::width |