AssertLockHeld failure in auxpow_miner
Closed this issue · 2 comments
JeremyRand commented
Cirrus is surfacing an AssertLockHeld
failure in auxpow_miner.cpp
in the auxpow
branch. See this Cirrus CI report: https://github.com/namecoin/namecoin-core/runs/1549193209 . bitcoin
branch is not affected.
Expected behavior
The "Cirrus CI / [depends, sanitizers: memory (MSan)] [focal]" run should pass.
Actual behavior
The run yields the following output:
CXX node/libbitcoin_server_a-coinstats.o
CXX node/libbitcoin_server_a-context.o
CXX node/libbitcoin_server_a-interfaces.o
CXX node/libbitcoin_server_a-psbt.o
CXX node/libbitcoin_server_a-transaction.o
CXX node/libbitcoin_server_a-ui_interface.o
CXX policy/libbitcoin_server_a-fees.o
CXX policy/libbitcoin_server_a-rbf.o
CXX policy/libbitcoin_server_a-settings.o
CXX rpc/libbitcoin_server_a-auxpow_miner.o
CXX rpc/libbitcoin_server_a-blockchain.o
CXX rpc/libbitcoin_server_a-mining.o
CXX rpc/libbitcoin_server_a-misc.o
rpc/auxpow_miner.cpp:58:3: error: calling function 'AssertLockHeldInternal<AnnotatedMixin<std::__1::recursive_mutex> >' requires holding mutex 'cs' exclusively [-Werror,-Wthread-safety-analysis]
AssertLockHeld (cs);
^
./sync.h:81:28: note: expanded from macro 'AssertLockHeld'
#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
^
rpc/auxpow_miner.cpp:124:3: error: calling function 'AssertLockHeldInternal<AnnotatedMixin<std::__1::recursive_mutex> >' requires holding mutex 'cs' exclusively [-Werror,-Wthread-safety-analysis]
AssertLockHeld (cs);
^
./sync.h:81:28: note: expanded from macro 'AssertLockHeld'
#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
^
2 errors generated.
make[2]: *** [Makefile:12218: rpc/libbitcoin_server_a-auxpow_miner.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src'
make[1]: *** [Makefile:19433: install-recursive] Error 1
make[1]: Leaving directory '/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src'
make: *** [Makefile:804: install-recursive] Error 1
Build failure. Verbose build follows.
Making install in src
make[1]: Entering directory '/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src'
make[2]: Entering directory '/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src'
/usr/bin/ccache clang++ -std=c++17 -DHAVE_CONFIG_H -I. -I../src/config -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I. -I./secp256k1/include -isystem /tmp/cirrus-ci-build/db4/include -DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC -pthread -isystem /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include -I./leveldb/include -I./leveldb/helpers/memenv -I./univalue/include -I/tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include -pthread -I/tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include -I/tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/ -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -Wstack-protector -fstack-protector-all -fcf-protection=full -Werror=gnu -Werror=vla -Werror=shadow-field -Werror=switch -Werror=thread-safety -Werror=range-loop-analysis -Werror=unused-variable -Werror=date-time -Werror=return-type -Werror=conditional-uninitialized -Werror=sign-compare -Werror=unreachable-code-loop-increment -fsanitize=memory -fPIE -pipe -O2 -fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O1 -fno-optimize-sibling-calls -nostdinc++ -stdlib=libc++ -L/tmp/cirrus-ci-build/ci/scratch/msan/build/lib -lc++abi -I/tmp/cirrus-ci-build/ci/scratch/msan/build/include -I/tmp/cirrus-ci-build/ci/scratch/msan/build/include/c++/v1 -lpthread -Wl,-rpath,/tmp/cirrus-ci-build/ci/scratch/msan/build/lib -Wno-unused-command-line-argument -c -o rpc/libbitcoin_server_a-auxpow_miner.o `test -f 'rpc/auxpow_miner.cpp' || echo './'`rpc/auxpow_miner.cpp
rpc/auxpow_miner.cpp:58:3: error: calling function 'AssertLockHeldInternal<AnnotatedMixin<std::__1::recursive_mutex> >' requires holding mutex 'cs' exclusively [-Werror,-Wthread-safety-analysis]
AssertLockHeld (cs);
^
./sync.h:81:28: note: expanded from macro 'AssertLockHeld'
#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
^
rpc/auxpow_miner.cpp:124:3: error: calling function 'AssertLockHeldInternal<AnnotatedMixin<std::__1::recursive_mutex> >' requires holding mutex 'cs' exclusively [-Werror,-Wthread-safety-analysis]
AssertLockHeld (cs);
^
./sync.h:81:28: note: expanded from macro 'AssertLockHeld'
#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
^
2 errors generated.
make[2]: *** [Makefile:12218: rpc/libbitcoin_server_a-auxpow_miner.o] Error 1
make[2]: Leaving directory '/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src'
make[1]: *** [Makefile:19433: install-recursive] Error 1
make[1]: Leaving directory '/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src'
make: *** [Makefile:804: install-recursive] Error 1
������������������������
To reproduce
Run the "Cirrus CI / [depends, sanitizers: memory (MSan)] [focal]" job.
System information
Namecoin Core auxpow
branch, 0a8158b . Built on Cirrus CI.
domob1812 commented
Thanks for the report, seems this is something only clang
complains about and not gcc
. Will probably be easy to fix, I'll take a look.