Skip to content

Conversation

fanquake
Copy link
Member

@fanquake fanquake commented Apr 11, 2023

Followup to #27447.

See https://releases.llvm.org/16.0.0/projects/libcxx/docs/DesignDocs/DebugMode.html:

Libc++ provides a debug mode that enables special debugging checks meant to detect incorrect usage of the standard library. These checks are disabled by default, but they can be enabled by vendors when building the library by using LIBCXX_ENABLE_DEBUG_MODE.

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 11, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK MarcoFalke

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@DrahtBot DrahtBot changed the title ci: build libc++ in DEBUG mode in MSAN jobs ci: build libc++ in DEBUG mode in MSAN jobs Apr 11, 2023
@DrahtBot DrahtBot added the Tests label Apr 11, 2023
@fanquake fanquake force-pushed the msan_with_enable_debug_mode branch from fc1af71 to a6915da Compare April 11, 2023 16:30
@fanquake fanquake force-pushed the msan_with_enable_debug_mode branch from 2fe833c to 4de9c2a Compare April 19, 2023 10:55
@fanquake fanquake marked this pull request as ready for review April 19, 2023 10:55
@fanquake
Copy link
Member Author

Rebased post #27447.

@maflcko
Copy link
Member

maflcko commented Apr 19, 2023

is DEBUG=1 enabled for them as well in depends?

Edit: I guess that would make them unusably slow?

@fanquake
Copy link
Member Author

fanquake commented Apr 19, 2023

is DEBUG=1 enabled for them as well in depends?
Edit: I guess that would make them unusably slow?

They don't run too slow, but they seem to find bugs. #27222 reproduces on x86_64:

wallet/test/feebumper_tests.cpp(18): Entering test suite "feebumper_tests"
wallet/test/feebumper_tests.cpp(42): Entering test case "external_max_weight_test"
2023-04-19T14:50:06Z Seed: Setting random seed for current tests to RANDOM_CTX_SEED=bcbaed399ecb4b53cf5998534b1cb7a9bdddd1c1755a5766212f5af3ac9745c2
2023-04-19T14:50:06.208691Z [test] [init/common.cpp:150] [LogPackageVersion] Bitcoin Core version v24.99.0-df230b476635 (release build)
2023-04-19T14:50:06.209990Z [test] [kernel/context.cpp:21] [Context] Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation
2023-04-19T14:50:06.210154Z [test] [random.cpp:99] [ReportHardwareRand] Using RdSeed as an additional entropy source
2023-04-19T14:50:06.210296Z [test] [random.cpp:102] [ReportHardwareRand] Using RdRand as an additional entropy source
2023-04-19T14:50:06.240134Z [test] [script/sigcache.cpp:103] [InitSignatureCache] Using 16 MiB out of 16 MiB requested for signature cache, able to store 524288 elements
2023-04-19T14:50:06.268452Z [test] [validation.cpp:1747] [InitScriptExecutionCache] Using 16 MiB out of 16 MiB requested for script execution cache, able to store 524288 elements
2023-04-19T14:50:06.269089Z [scheduler] [util/thread.cpp:20] [TraceThread] scheduler thread start
2023-04-19T14:50:06.272308Z [test] [policy/fees.cpp:551] [CBlockPolicyEstimator] Failed to read fee estimates from /tmp/test_common_Bitcoin Core/6e563b3d9911b27f87e09262af2afa0b6d61b8f9d475923100191822474c5cee/fee_estimates.dat. Continue anyway.
2023-04-19T14:50:06.273678Z [test] [dbwrapper.cpp:158] [CDBWrapper] Opened LevelDB successfully
2023-04-19T14:50:06.273925Z [test] [dbwrapper.cpp:183] [CDBWrapper] Using obfuscation key for /tmp/test_common_Bitcoin Core/6e563b3d9911b27f87e09262af2afa0b6d61b8f9d475923100191822474c5cee/blocks/index: 0000000000000000
2023-04-19T14:50:06.396567Z [test] [node/chainstate.cpp:165] [LoadChainstate] Assuming ancestors of block 00000000000000000009c97098b5295f7e5f183ac811fb5d1534040adb93cabd have valid signatures.
2023-04-19T14:50:06.396768Z [test] [node/chainstate.cpp:169] [LoadChainstate] Setting nMinimumChainWork=00000000000000000000000000000000000000003404ba0801921119f903495e
2023-04-19T14:50:06.397711Z [test] [dbwrapper.cpp:158] [CDBWrapper] Opened LevelDB successfully
2023-04-19T14:50:06.397958Z [test] [dbwrapper.cpp:183] [CDBWrapper] Using obfuscation key for /tmp/test_common_Bitcoin Core/6e563b3d9911b27f87e09262af2afa0b6d61b8f9d475923100191822474c5cee/blocks/index: 0000000000000000
2023-04-19T14:50:06.398296Z [test] [node/blockstorage.cpp:329] [LoadBlockIndexDB] LoadBlockIndexDB: last block file = 0
2023-04-19T14:50:06.398584Z [test] [node/blockstorage.cpp:333] [LoadBlockIndexDB] LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=0, size=0, heights=0...0, time=1970-01-01...1970-01-01)
2023-04-19T14:50:06.398774Z [test] [node/blockstorage.cpp:344] [LoadBlockIndexDB] Checking all blk files are present...
2023-04-19T14:50:06.399089Z [test] [validation.cpp:4494] [LoadBlockIndex] Initializing databases...
2023-04-19T14:50:06.399493Z [test] [flatfile.cpp:69] [Allocate] [validation] Pre-allocating up to position 0x1000000 in blk00000.dat
2023-04-19T14:50:06.399937Z [test] [node/chainstate.cpp:107] [CompleteChainstateInitialization] Initializing chainstate Chainstate [ibd] @ height -1 (null)
2023-04-19T14:50:06.400680Z [test] [dbwrapper.cpp:158] [CDBWrapper] Opened LevelDB successfully
2023-04-19T14:50:06.401046Z [test] [dbwrapper.cpp:180] [CDBWrapper] Wrote new obfuscate key for /tmp/test_common_Bitcoin Core/6e563b3d9911b27f87e09262af2afa0b6d61b8f9d475923100191822474c5cee/chainstate: f99c9db210c2a968
2023-04-19T14:50:06.401256Z [test] [dbwrapper.cpp:183] [CDBWrapper] Using obfuscation key for /tmp/test_common_Bitcoin Core/6e563b3d9911b27f87e09262af2afa0b6d61b8f9d475923100191822474c5cee/chainstate: f99c9db210c2a968
2023-04-19T14:50:06.401590Z [test] [validation.cpp:5539] [MaybeRebalanceCaches] [snapshot] allocating all cache to the IBD chainstate
2023-04-19T14:50:06.401792Z [test] [validation.cpp:4921] [ResizeCoinsCaches] [Chainstate [ibd] @ height -1 (null)] resized coinsdb cache to 8.0 MiB
2023-04-19T14:50:06.401985Z [test] [validation.cpp:4923] [ResizeCoinsCaches] [Chainstate [ibd] @Uninitialized bytes in __interceptor_strlen at offset 9 inside [0x72e00000b9a8, 10)
==38655==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x555f25637ceb in sqlite3Strlen30 /home/ubuntu/bitcoin/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-7fe5d5b9fee/sqlite3.c:32670:28
    #1 0x555f25685834 in sqlite3VdbeExec /home/ubuntu/bitcoin/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-7fe5d5b9fee/sqlite3.c:88638:13
    #2 0x555f256422a8 in sqlite3Step /home/ubuntu/bitcoin/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-7fe5d5b9fee/sqlite3.c:85780:10
    #3 0x555f2563a761 in sqlite3_step /home/ubuntu/bitcoin/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-7fe5d5b9fee/sqlite3.c:85837:16
    #4 0x555f25648a57 in sqlite3_exec /home/ubuntu/bitcoin/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-7fe5d5b9fee/sqlite3.c:128170:12
    #5 0x555f2443a03d in wallet::SetPragma(sqlite3*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) src/wallet/sqlite.cpp:77:15
    #6 0x555f24437ffd in wallet::SQLiteDatabase::Open() src/wallet/sqlite.cpp:245:5
    #7 0x555f24431aed in wallet::SQLiteDatabase::SQLiteDatabase(fs::path const&, fs::path const&, wallet::DatabaseOptions const&, bool) src/wallet/sqlite.cpp:113:9
    #8 0x555f243d3558 in std::__1::__unique_if<wallet::SQLiteDatabase>::__unique_single std::__1::make_unique[abi:v160001]<wallet::SQLiteDatabase, char const (&) [9], char const (&) [1], wallet::DatabaseOptions&, bool>(char const (&) [9], char const (&) [1], wallet::DatabaseOptions&, bool&&) /home/ubuntu/bitcoin/ci/scratch/msan/build/include/c++/v1/__memory/unique_ptr.h:686:30
    #9 0x555f243cbba4 in wallet::CreateMockWalletDatabase(wallet::DatabaseOptions&) src/wallet/walletdb.cpp:1264:16
    #10 0x555f243cbba4 in wallet::CreateMockWalletDatabase() src/wallet/walletdb.cpp:1278:12
    #11 0x555f22b58a8e in wallet::WalletTestingSetup::WalletTestingSetup(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) src/wallet/test/wallet_test_fixture.cpp:13:40
    #12 0x555f23e53db3 in wallet::feebumper::feebumper_tests::external_max_weight_test::external_max_weight_test() src/wallet/test/feebumper_tests.cpp:42:1
    #13 0x555f23e53db3 in wallet::feebumper::feebumper_tests::external_max_weight_test_invoker() src/wallet/test/feebumper_tests.cpp:42:1
    #14 0x555f22c4ab35 in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:117:11
    #15 0x555f22b47bbe in boost::function0<void>::operator()() const /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:763:14
    #16 0x555f22b47bbe in boost::detail::forward::operator()() /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1388:32
    #17 0x555f22b47bbe in boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:137:18
    #18 0x555f22a1b302 in boost::function0<int>::operator()() const /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:763:14
    #19 0x555f22a1b302 in int boost::detail::do_invoke<boost::shared_ptr<boost::detail::translator_holder_base>, boost::function<int ()>>(boost::shared_ptr<boost::detail::translator_holder_base> const&, boost::function<int ()> const&) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:301:30
    #20 0x555f22a1b302 in boost::execution_monitor::catch_signals(boost::function<int ()> const&) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:903:16
    #21 0x555f22a1b98a in boost::execution_monitor::execute(boost::function<int ()> const&) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1301:16
    #22 0x555f22a12d7a in boost::execution_monitor::vexecute(boost::function<void ()> const&) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1397:5
    #23 0x555f22a12d7a in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_monitor.ipp:49:9
    #24 0x555f22a8e1bb in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:815:44
    #25 0x555f22a8eecb in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:784:58
    #26 0x555f22a8eecb in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:784:58
    #27 0x555f22a0fa1e in boost::unit_test::framework::run(unsigned long, bool) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:1722:29
    #28 0x555f22a490ec in boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_main.ipp:250:9
    #29 0x555f22a4a1d4 in main /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_main.ipp:306:12
    #30 0x7f0ae3d58a8f  (/lib/x86_64-linux-gnu/libc.so.6+0x23a8f) (BuildId: bdb8aa3b1b60f9d43e1c70ba98158e05f765efdc)
    #31 0x7f0ae3d58b48 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23b48) (BuildId: bdb8aa3b1b60f9d43e1c70ba98158e05f765efdc)
    #32 0x555f22956fe4 in _start (/home/ubuntu/bitcoin/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/test_bitcoin+0x177fe4) (BuildId: 633af1da154757ae52d66bed70e34016956c7d12)

  Uninitialized value was created by a heap allocation
    #0 0x555f2298a532 in malloc (/home/ubuntu/bitcoin/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/test_bitcoin+0x1ab532) (BuildId: 633af1da154757ae52d66bed70e34016956c7d12)
    #1 0x555f2575f109 in sqlite3MemMalloc /home/ubuntu/bitcoin/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-7fe5d5b9fee/sqlite3.c:25163:7
    #2 0x555f2565545c in mallocWithAlarm /home/ubuntu/bitcoin/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-7fe5d5b9fee/sqlite3.c:28846:7
    #3 0x555f25633f59 in sqlite3Malloc /home/ubuntu/bitcoin/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-7fe5d5b9fee/sqlite3.c:28876:5
    #4 0x555f2564d744 in setupLookaside /home/ubuntu/bitcoin/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-7fe5d5b9fee/sqlite3.c:169302:14
    #5 0x555f25650615 in openDatabase /home/ubuntu/bitcoin/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-7fe5d5b9fee/sqlite3.c:171986:3
    #6 0x555f2565076a in sqlite3_open_v2 /home/ubuntu/bitcoin/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-7fe5d5b9fee/sqlite3.c:172034:10
    #7 0x555f24437e87 in wallet::SQLiteDatabase::Open() src/wallet/sqlite.cpp:229:19
    #8 0x555f24431aed in wallet::SQLiteDatabase::SQLiteDatabase(fs::path const&, fs::path const&, wallet::DatabaseOptions const&, bool) src/wallet/sqlite.cpp:113:9
    #9 0x555f243d3558 in std::__1::__unique_if<wallet::SQLiteDatabase>::__unique_single std::__1::make_unique[abi:v160001]<wallet::SQLiteDatabase, char const (&) [9], char const (&) [1], wallet::DatabaseOptions&, bool>(char const (&) [9], char const (&) [1], wallet::DatabaseOptions&, bool&&) /home/ubuntu/bitcoin/ci/scratch/msan/build/include/c++/v1/__memory/unique_ptr.h:686:30
    #10 0x555f243cbba4 in wallet::CreateMockWalletDatabase(wallet::DatabaseOptions&) src/wallet/walletdb.cpp:1264:16
    #11 0x555f243cbba4 in wallet::CreateMockWalletDatabase() src/wallet/walletdb.cpp:1278:12
    #12 0x555f22b58a8e in wallet::WalletTestingSetup::WalletTestingSetup(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) src/wallet/test/wallet_test_fixture.cpp:13:40
    #13 0x555f23e53db3 in wallet::feebumper::feebumper_tests::external_max_weight_test::external_max_weight_test() src/wallet/test/feebumper_tests.cpp:42:1
    #14 0x555f23e53db3 in wallet::feebumper::feebumper_tests::external_max_weight_test_invoker() src/wallet/test/feebumper_tests.cpp:42:1
    #15 0x555f22c4ab35 in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:117:11
    #16 0x555f22b47bbe in boost::function0<void>::operator()() const /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:763:14
    #17 0x555f22b47bbe in boost::detail::forward::operator()() /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1388:32
    #18 0x555f22b47bbe in boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:137:18
    #19 0x555f22a1b302 in boost::function0<int>::operator()() const /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:763:14
    #20 0x555f22a1b302 in int boost::detail::do_invoke<boost::shared_ptr<boost::detail::translator_holder_base>, boost::function<int ()>>(boost::shared_ptr<boost::detail::translator_holder_base> const&, boost::function<int ()> const&) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:301:30
    #21 0x555f22a1b302 in boost::execution_monitor::catch_signals(boost::function<int ()> const&) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:903:16
    #22 0x555f22a1b98a in boost::execution_monitor::execute(boost::function<int ()> const&) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1301:16
    #23 0x555f22a12d7a in boost::execution_monitor::vexecute(boost::function<void ()> const&) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1397:5
    #24 0x555f22a12d7a in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_monitor.ipp:49:9
    #25 0x555f22a8e1bb in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:815:44
    #26 0x555f22a8eecb in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:784:58

SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/ubuntu/bitcoin/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-7fe5d5b9fee/sqlite3.c:32670:28 in sqlite3Strlen30
Exiting

Different on aarch64:

2023-04-19T14:57:40.859244Z [test] [validation.cpp:2834] [ConnectTip] [bench]   - Load block from disk: 0.33ms [0.00s (infms/blk)]
2023-04-19T14:57:40.859773Z [test] [validationinterface.cpp:25Uninitialized bytes in __interceptor_strcmp at offset 0 inside [0xe01000000e0c, 1)
==37748==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0xaaaab8a82008 in sqlite3BtreeOpen /home/fedora/ci_scratch/depends/work/build/aarch64-unknown-linux-gnu/sqlite/3380500-b73e7dadeab/sqlite3.c:68556:37
    #1 0xaaaab8a71ddc in openDatabase /home/fedora/ci_scratch/depends/work/build/aarch64-unknown-linux-gnu/sqlite/3380500-b73e7dadeab/sqlite3.c:171911:8
    #2 0xaaaab8a721e4 in sqlite3_open_v2 /home/fedora/ci_scratch/depends/work/build/aarch64-unknown-linux-gnu/sqlite/3380500-b73e7dadeab/sqlite3.c:172034:10
    #3 0xaaaab7c216c8 in wallet::SQLiteDatabase::Open() src/wallet/sqlite.cpp:229:19
    #4 0xaaaab7c1c39c in wallet::SQLiteDatabase::SQLiteDatabase(fs::path const&, fs::path const&, wallet::DatabaseOptions const&, bool) src/wallet/sqlite.cpp:113:9
    #5 0xaaaab7bd1304 in std::__1::__unique_if<wallet::SQLiteDatabase>::__unique_single std::__1::make_unique[abi:v160001]<wallet::SQLiteDatabase, char const (&) [9], char const (&) [1], wallet::DatabaseOptions&, bool>(char const (&) [9], char const (&) [1], wallet::DatabaseOptions&, bool&&) /home/fedora/ci_scratch/ci/scratch/msan/build/include/c++/v1/__memory/unique_ptr.h:686:30
    #6 0xaaaab7bcaab4 in wallet::CreateMockWalletDatabase(wallet::DatabaseOptions&) src/wallet/walletdb.cpp:1264:16
    #7 0xaaaab7bcaab4 in wallet::CreateMockWalletDatabase() src/wallet/walletdb.cpp:1278:12
    #8 0xaaaab6789c44 in wallet::WalletTestingSetup::WalletTestingSetup(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) src/wallet/test/wallet_test_fixture.cpp:13:40
    #9 0xaaaab77ba048 in wallet::wallet_tests::ComputeTimeSmart::ComputeTimeSmart() src/wallet/test/wallet_tests.cpp:407:1
    #10 0xaaaab77ba048 in wallet::wallet_tests::ComputeTimeSmart_invoker() src/wallet/test/wallet_tests.cpp:407:1
    #11 0xaaaab6852558 in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:117:11
    #12 0xaaaab677be68 in boost::function0<void>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14
    #13 0xaaaab677be68 in boost::detail::forward::operator()() /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1388:32
    #14 0xaaaab677be68 in boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:137:18
    #15 0xaaaab6685144 in boost::function0<int>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14
    #16 0xaaaab6685144 in int boost::detail::do_invoke<boost::shared_ptr<boost::detail::translator_holder_base>, boost::function<int ()>>(boost::shared_ptr<boost::detail::translator_holder_base> const&, boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:301:30
    #17 0xaaaab6685144 in boost::execution_monitor::catch_signals(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:903:16
    #18 0xaaaab66856c8 in boost::execution_monitor::execute(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1301:16
    #19 0xaaaab667dcc0 in boost::execution_monitor::vexecute(boost::function<void ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1397:5
    #20 0xaaaab667dcc0 in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_monitor.ipp:49:9
    #21 0xaaaab66e2808 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:815:44
    #22 0xaaaab66e2218 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:784:58
    #23 0xaaaab66e2218 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:784:58
    #24 0xaaaab667ae10 in boost::unit_test::framework::run(unsigned long, bool) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:1722:29
    #25 0xaaaab66aadb4 in boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_main.ipp:250:9
    #26 0xaaaab66abb98 in main /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_main.ipp:306:12
    #27 0xffff91066dbc  (/lib/aarch64-linux-gnu/libc.so.6+0x26dbc) (BuildId: 9efe43e32e614cad22a180ef036eea6154eafdc2)
    #28 0xffff91066e94 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x26e94) (BuildId: 9efe43e32e614cad22a180ef036eea6154eafdc2)
    #29 0xaaaab65cd6ec in _start (/home/fedora/ci_scratch/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/src/test/test_bitcoin+0x15d6ec) (BuildId: 78bb98243eb0da25c31e795ae10bd1ff4597c7e4)

  Uninitialized value was created by a heap allocation
    #0 0xaaaab65ffd14 in malloc (/home/fedora/ci_scratch/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/src/test/test_bitcoin+0x18fd14) (BuildId: 78bb98243eb0da25c31e795ae10bd1ff4597c7e4)
    #1 0xaaaab8bb18d4 in sqlite3MemMalloc /home/fedora/ci_scratch/depends/work/build/aarch64-unknown-linux-gnu/sqlite/3380500-b73e7dadeab/sqlite3.c:25163:7
    #2 0xaaaab8a77948 in mallocWithAlarm /home/fedora/ci_scratch/depends/work/build/aarch64-unknown-linux-gnu/sqlite/3380500-b73e7dadeab/sqlite3.c:28846:7
    #3 0xaaaab8a508bc in sqlite3Malloc /home/fedora/ci_scratch/depends/work/build/aarch64-unknown-linux-gnu/sqlite/3380500-b73e7dadeab/sqlite3.c:28876:5
    #4 0xaaaab8a5096c in sqlite3_malloc64 /home/fedora/ci_scratch/depends/work/build/aarch64-unknown-linux-gnu/sqlite/3380500-b73e7dadeab/sqlite3.c:28900:10
    #5 0xaaaab8b9aca4 in sqlite3ParseUri /home/fedora/ci_scratch/depends/work/build/aarch64-unknown-linux-gnu/sqlite/3380500-b73e7dadeab/sqlite3.c:171638:13
    #6 0xaaaab8a71d34 in openDatabase /home/fedora/ci_scratch/depends/work/build/aarch64-unknown-linux-gnu/sqlite/3380500-b73e7dadeab/sqlite3.c:171901:10
    #7 0xaaaab8a721e4 in sqlite3_open_v2 /home/fedora/ci_scratch/depends/work/build/aarch64-unknown-linux-gnu/sqlite/3380500-b73e7dadeab/sqlite3.c:172034:10
    #8 0xaaaab7c216c8 in wallet::SQLiteDatabase::Open() src/wallet/sqlite.cpp:229:19
    #9 0xaaaab7c1c39c in wallet::SQLiteDatabase::SQLiteDatabase(fs::path const&, fs::path const&, wallet::DatabaseOptions const&, bool) src/wallet/sqlite.cpp:113:9
    #10 0xaaaab7bd1304 in std::__1::__unique_if<wallet::SQLiteDatabase>::__unique_single std::__1::make_unique[abi:v160001]<wallet::SQLiteDatabase, char const (&) [9], char const (&) [1], wallet::DatabaseOptions&, bool>(char const (&) [9], char const (&) [1], wallet::DatabaseOptions&, bool&&) /home/fedora/ci_scratch/ci/scratch/msan/build/include/c++/v1/__memory/unique_ptr.h:686:30
    #11 0xaaaab7bcaab4 in wallet::CreateMockWalletDatabase(wallet::DatabaseOptions&) src/wallet/walletdb.cpp:1264:16
    #12 0xaaaab7bcaab4 in wallet::CreateMockWalletDatabase() src/wallet/walletdb.cpp:1278:12
    #13 0xaaaab6789c44 in wallet::WalletTestingSetup::WalletTestingSetup(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) src/wallet/test/wallet_test_fixture.cpp:13:40
    #14 0xaaaab77ba048 in wallet::wallet_tests::ComputeTimeSmart::ComputeTimeSmart() src/wallet/test/wallet_tests.cpp:407:1
    #15 0xaaaab77ba048 in wallet::wallet_tests::ComputeTimeSmart_invoker() src/wallet/test/wallet_tests.cpp:407:1
    #16 0xaaaab6852558 in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:117:11
    #17 0xaaaab677be68 in boost::function0<void>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14
    #18 0xaaaab677be68 in boost::detail::forward::operator()() /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1388:32
    #19 0xaaaab677be68 in boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:137:18
    #20 0xaaaab6685144 in boost::function0<int>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14
    #21 0xaaaab6685144 in int boost::detail::do_invoke<boost::shared_ptr<boost::detail::translator_holder_base>, boost::function<int ()>>(boost::shared_ptr<boost::detail::translator_holder_base> const&, boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:301:30
    #22 0xaaaab6685144 in boost::execution_monitor::catch_signals(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:903:16
    #23 0xaaaab66856c8 in boost::execution_monitor::execute(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1301:16
    #24 0xaaaab667dcc0 in boost::execution_monitor::vexecute(boost::function<void ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1397:5
    #25 0xaaaab667dcc0 in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_monitor.ipp:49:9
    #26 0xaaaab66e2808 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:815:44

SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/fedora/ci_scratch/depends/work/build/aarch64-unknown-linux-gnu/sqlite/3380500-b73e7dadeab/sqlite3.c:68556:37 in sqlite3BtreeOpen
Exiting

Pushed DEBUG=1 up here to see if it also recreates in the native_msan CI. (cancelled all other tasks).

@@ -15,7 +15,7 @@ export MSAN_AND_LIBCXX_FLAGS="${MSAN_FLAGS} ${LIBCXX_FLAGS}"
export CONTAINER_NAME="ci_native_msan"
export PACKAGES="clang-16 llvm-16 libclang-rt-16-dev cmake"
# BDB generates false-positives and will be removed in future
export DEP_OPTS="NO_BDB=1 NO_QT=1 CC='clang' CXX='clang++' CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
export DEP_OPTS="DEBUG=1 NO_BDB=1 NO_QT=1 CC='clang' CXX='clang++' CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to set this for the fuzz msan task?

Copy link
Member

@maflcko maflcko Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And given that the CI fails here (c.f. https://cirrus-ci.com/task/5681913176784896?logs=ci#L2667), maybe add it to the msan task in a follow-up and only set it on the fuzz msan task?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to set this for the fuzz msan task?

I didn't bother as that isn't run here, and wouldn't compile rn (master) in any case.

maybe add it to the msan task in a follow-up and only set it on the fuzz msan task?

I think I'd rather defer to adding both, at the same time, in a follow up, if you're alright with that. Can drop the test commit from this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Followed up in #27495.

@fanquake fanquake force-pushed the msan_with_enable_debug_mode branch from 1a666d7 to 4de9c2a Compare April 19, 2023 15:56
@maflcko
Copy link
Member

maflcko commented Apr 19, 2023

lgtm ACK 4de9c2a

@fanquake fanquake merged commit d26a71a into bitcoin:master Apr 19, 2023
@fanquake fanquake deleted the msan_with_enable_debug_mode branch April 19, 2023 17:18
fanquake added a commit to fanquake/bitcoin that referenced this pull request Apr 19, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Apr 20, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 21, 2023
4de9c2a ci: build libc++ with assertions in MSAN jobs (fanquake)
23b8b20 ci: build libc++ in DEBUG mode in MSAN jobs (fanquake)

Pull request description:

  Followup to bitcoin#27447.

  See https://releases.llvm.org/16.0.0/projects/libcxx/docs/DesignDocs/DebugMode.html:
  > Libc++ provides a debug mode that enables special debugging checks meant to detect incorrect usage of the standard library. These checks are disabled by default, but they can be enabled by vendors when building the library by using LIBCXX_ENABLE_DEBUG_MODE.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 4de9c2a

Tree-SHA512: 788c7f031ccf7a6ac96a87758e57f604cf4d9db0144f0ecc4931823111d2396e64ab260825d74f06b2770d0ac3e4e2c21c46f4def046cf3e1a44d705921ab6d2
fanquake added a commit to fanquake/bitcoin that referenced this pull request May 17, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
achow101 pushed a commit to achow101/bitcoin that referenced this pull request May 17, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Jun 2, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Jun 20, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Jun 20, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Jun 21, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Aug 23, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Sep 11, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Sep 14, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Sep 16, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Oct 16, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Oct 16, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Nov 6, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Nov 6, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Nov 6, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Nov 6, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Nov 16, 2023
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Jan 5, 2024
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Jan 24, 2024
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Jan 25, 2024
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Jan 25, 2024
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
fanquake added a commit to fanquake/bitcoin that referenced this pull request Jan 26, 2024
Followup to bitcoin#27448, which was deffered, as it produces bitcoin#27448 and
another similar issue in sqlite, see comment here:
bitcoin#27448 (comment).
janus pushed a commit to BitgesellOfficial/bitgesell that referenced this pull request Apr 6, 2024
Followup to #27448, which was deffered, as it produces #27448 and
another similar issue in sqlite, see comment here:
bitcoin/bitcoin#27448 (comment).
@bitcoin bitcoin locked and limited conversation to collaborators Apr 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants