Page MenuHomePhabricator

tsan: Suppress epoll_ctl data race
ClosedPublic

Authored by PiRK on Dec 22 2021, 09:54.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCb3c5178d5e4b: tsan: Suppress epoll_ctl data race
Summary

It seems the data race in epoll_ctl could be false positive, and be caused by clang tsan instrumentation code (e.g., https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20131007/190642.html). But not for sure, of course.

This is a backport of core#20218 and core#20745

Note: I wasn't able to reproduce it today in a loop of 10 ninja check-functional, but I have seen this race in the past. I have a log file locally with a ThreadSanitizer data race involving epoll_ctl.

Test Plan

With TSAN:

for i in `seq 10`; do  ninja check-functional; done

Diff Detail

Event Timeline

PiRK requested review of this revision.Dec 22 2021, 09:54

Failed tests logs:

====== Bitcoin ABC functional tests: p2p_getaddr_caching.py ======

------- Stdout: -------
2021-12-22T09:57:26.864000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20211222_095624/p2p_getaddr_caching_46
2021-12-22T09:57:27.165000Z TestFramework (INFO): Fill peer AddrMan with a lot of records
2021-12-22T09:57:30.861000Z TestFramework (INFO): Send many addr requests within short time to receive
2021-12-22T09:58:31.547000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
'''
2021-12-22T09:58:31.547000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 132, in main
    self.run_test()
  File "/work/test/functional/p2p_getaddr_caching.py", line 68, in run_test
    addr_receiver.wait_until(addr_receiver.addr_received)
  File "/work/test/functional/test_framework/p2p.py", line 485, in wait_until
    timeout_factor=self.timeout_factor)
  File "/work/test/functional/test_framework/util.py", line 286, in wait_until_helper
    "Predicate {} not true after {} seconds".format(predicate_source, timeout))
AssertionError: Predicate ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
''' not true after 60.0 seconds
2021-12-22T09:58:31.598000Z TestFramework (INFO): Stopping nodes
2021-12-22T09:58:33.258000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20211222_095624/p2p_getaddr_caching_46
2021-12-22T09:58:33.258000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20211222_095624/p2p_getaddr_caching_46/test_framework.log
2021-12-22T09:58:33.258000Z TestFramework (ERROR): 
2021-12-22T09:58:33.258000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20211222_095624/p2p_getaddr_caching_46' to consolidate all logs
2021-12-22T09:58:33.258000Z TestFramework (ERROR): 
2021-12-22T09:58:33.258000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-12-22T09:58:33.259000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-12-22T09:58:33.259000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: p2p_getaddr_caching.py

This revision is now accepted and ready to land.Dec 22 2021, 11:16
This revision was automatically updated to reflect the committed changes.