Skip to content

Commit

Permalink
[backport#19041] ci: tsan with -stdlib=libc++-10
Browse files Browse the repository at this point in the history
Summary:
~~ci: Remove unused workaround (MarcoFalke)~~
~~ci: Install llvm to get llvm symbolizer (MarcoFalke)~~
test: Add more tsan suppressions (MarcoFalke)
~~ci: Mute depends logs completely (MarcoFalke)~~
test: Extend tsan suppressions for clang stdlib (MarcoFalke)
~~ci: Use libc++ instead of libstdc++ for tsan (MarcoFalke)~~
~~ci: Set halt_on_error=1 for tsan (MarcoFalke)~~
~~ci: Deduplicate DOCKER_EXEC (MarcoFalke)~~
~~cirrus: Remove no longer needed install step (MarcoFalke)~~

Pull request description:

  According to the [ThreadSanitizer docs](https://clang.llvm.org/docs/ThreadSanitizer.html#current-status):
  >  C++11 threading is supported with **llvm libc++**.

  For example, the thread sanitizer build is currently not checking for double lock of mutexes.

  Fixes (partially) bitcoin/bitcoin#19038 (comment)

---

EDIT: included our own code's suppressions so the test is green

Backport of Core [[bitcoin/bitcoin#19041 | PR19041]]

Test Plan:
with clang-10 on archlinux:
  cmake -GNinja -DENABLE_SANITIZERS=thread -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
  ninja check check-functional

threadsanitizer is green ~~only gives out warnings about code that is exclusive to us (specifically, rcu_tests.cpp and doublelock of mutex in paymentserver qt code)~~

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7547
  • Loading branch information
fanquake authored and majcosta committed Sep 24, 2020
1 parent 30f9859 commit 9323795
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion test/sanitizer_suppressions/tsan
Original file line number Diff line number Diff line change
@@ -1,19 +1,43 @@
# ThreadSanitizer suppressions
# ============================

# double locks (TODO fix)
mutex:g_genesis_wait_mutex
mutex:Interrupt
mutex:CThreadInterrupt
mutex:CConnman::Interrupt
mutex:CConnman::WakeMessageHandler
mutex:CConnman::ThreadOpenConnections
mutex:CConnman::ThreadOpenAddedConnections
mutex:CConnman::SocketHandler
mutex:UpdateTip
mutex:PeerLogicValidation::UpdatedBlockTip
mutex:rcu_tests::synchronize_test
# race (TODO fix)
race:CConnman::WakeMessageHandler
race:CConnman::ThreadMessageHandler
race:fHaveGenesis
race:ProcessNewBlock
race:ThreadImport
race:zmq::*
race:bitcoin-qt
# deadlock (TODO fix)
deadlock:CConnman::ForNode
deadlock:UpdateTip

# WalletBatch (unidentified deadlock)
deadlock:WalletBatch

# Intentional deadlock in tests
deadlock:TestPotentialDeadLockDetected

# Wildcard for all gui tests, should be replaced with non-wildcard suppressions
mutex:src/qt/test/*
race:src/qt/test/*
deadlock:src/qt/test/*

# External libraries
deadlock:libdb
race:libzmq

# Reverselock tests is triggering lock-order-inversion errors when run as part
# of test_bitcoin.
Expand Down

0 comments on commit 9323795

Please sign in to comment.