See https://libcxx.llvm.org/Hardening.html as well as https://discourse.llvm.org/t/rfc-removing-the-legacy-debug-mode-from-libc/71026.
ci: LLVM 17 for MSAN jobs #28476
pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:msan_17 changing 1 files +2 −3-
fanquake commented at 10:12 AM on September 14, 2023: member
-
a241d6069c
ci: use LLVM 17.0.0 in MSAN jobs
See https://libcxx.llvm.org/Hardening.html as well as https://discourse.llvm.org/t/rfc-removing-the-legacy-debug-mode-from-libc/71026.
-
DrahtBot commented at 10:12 AM on September 14, 2023: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
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 added the label Tests on Sep 14, 2023
-
maflcko commented at 11:34 AM on September 14, 2023: member
review ACK a241d6069cf0542acdd8ec6be63724da19f10720
red GHA can be ignored.
Seems fine to merge rc4, if CI likes it. We can do another bump in a few months to 17.0.1 (or similar).
Unrelated: May be good to also fixup the depends and oss-fuzz flags, in separate pull requests?
depends/hosts/linux.mk:linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -D_LIBCPP_ENABLE_ASSERTIONS=1 -
maflcko commented at 11:36 AM on September 14, 2023: member
Will also fixup the issue with $MAKEJOBS currently being a no-op during the Clang & libc++ builds.
Not sure, this also seems unrelated and hard to fix. You can either pass in the variable into the dockerfile, but then changing the variable requires a re-build of the (same) dockerfile, which doesn't make sense. Or you can completely ignore it and just use
nproc? I guess if someone wants to modify it, we'll let them modify the script by hand? - fanquake marked this as ready for review on Sep 14, 2023
-
fanquake commented at 12:22 PM on September 14, 2023: member
Seems fine to merge rc4, if CI likes it. We can do another bump in a few months to 17.0.1 (or similar).
Ok, this is fine with me.
Unrelated: May be good to also fixup the depends and oss-fuzz flags, in separate pull requests?
Will open a separate PR.
Not sure, this also seems unrelated and hard to fix.
Will punt this for now. Updated the PR description.
-
fanquake commented at 12:31 PM on September 14, 2023: member
Seems fine to merge rc4, if CI likes it.
MSan job is now green here.
- fanquake referenced this in commit 4a825039a5 on Sep 14, 2023
-
maflcko commented at 10:18 AM on September 15, 2023: member
rfm, or is something left to be done here?
- fanquake merged this on Sep 15, 2023
- fanquake closed this on Sep 15, 2023
- fanquake deleted the branch on Sep 15, 2023
-
maflcko commented at 12:35 PM on September 15, 2023: member
Looks like this broke fuzz msan? https://cirrus-ci.com/task/5290774615556096?logs=ci#L9230
-
fanquake commented at 12:56 PM on September 15, 2023: member
Weird. Taking a look.
-
Yugthakkar04 commented at 2:33 PM on September 15, 2023: none
change this alibi to the converge libc++ from on to off and switch it to an internal open source internet LLVM 17
reviewing console: https://discourse.llvm.org/t/rfc-removing-the-legacy-debug-mode-from-libc/71026
- fanquake referenced this in commit f01416e23c on Sep 16, 2023
- Frank-GER referenced this in commit 17a3555c06 on Sep 19, 2023
-
maflcko commented at 9:19 AM on September 19, 2023: member
Weird. Taking a look.
Seems to be passing on
aarch64, so far -
maflcko commented at 10:39 AM on September 19, 2023: member
on x86_64:
# PRINT_ALL_FUZZ_TARGETS_AND_ABORT=1 LD_LIBRARY_PATH=/ci_container_base/depends/x86_64-pc-linux-gnu/lib /ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/fuzz ==29942==WARNING: MemorySanitizer: use-of-uninitialized-value [#0](/bitcoin-bitcoin/0/) 0x561e032f63ff in SetArgs(int, char**) src/test/fuzz/fuzz.cpp:48:5 [#1](/bitcoin-bitcoin/1/) 0x561e032f63ff in LLVMFuzzerInitialize src/test/fuzz/fuzz.cpp:185:5 [#2](/bitcoin-bitcoin/2/) 0x561e02b5f6c3 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /msan/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:647:5 [#3](/bitcoin-bitcoin/3/) 0x561e02b8d9b2 in main /msan/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10 [#4](/bitcoin-bitcoin/4/) 0x7f37ebc51d8f (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 229b7dc509053fe4df5e29e8629911f0c3bc66dd) [#5](/bitcoin-bitcoin/5/) 0x7f37ebc51e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 229b7dc509053fe4df5e29e8629911f0c3bc66dd) [#6](/bitcoin-bitcoin/6/) 0x561e02b526d4 in _start (/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x8076d4) Member fields were destroyed [#0](/bitcoin-bitcoin/0/) 0x561e02c1d0fd in __sanitizer_dtor_callback_fields /msan/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:982:5 [#1](/bitcoin-bitcoin/1/) 0x561e04b809e8 in std::__1::unique_ptr<std::__1::__tree_node<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, void*>, std::__1::__tree_node_destructor<std::__1::allocator<std::__1::__tree_node<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, void*>>>>::~unique_ptr[abi:v170000]() /msan/cxx_build/include/c++/v1/__memory/unique_ptr.h:137:44 [#2](/bitcoin-bitcoin/2/) 0x561e04b809e8 in std::__1::unique_ptr<std::__1::__tree_node<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, void*>, std::__1::__tree_node_destructor<std::__1::allocator<std::__1::__tree_node<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, void*>>>>::~unique_ptr[abi:v170000]() /msan/cxx_build/include/c++/v1/__memory/unique_ptr.h:266:84 [#3](/bitcoin-bitcoin/3/) 0x561e04b809e8 in std::__1::pair<std::__1::__tree_iterator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::__tree_node<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, void*>*, long>, bool> std::__1::__tree<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::less<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>>::__emplace_unique_impl<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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) /msan/cxx_build/include/c++/v1/__tree:2167:1 [#4](/bitcoin-bitcoin/4/) 0x561e02b52504 in std::__1::pair<std::__1::__tree_iterator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::__tree_node<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, void*>*, long>, bool> std::__1::__tree<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::less<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>>::__emplace_unique[abi:v170000]<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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) /msan/cxx_build/include/c++/v1/__tree:1200:16 [#5](/bitcoin-bitcoin/5/) 0x561e02b52504 in std::__1::pair<std::__1::__tree_const_iterator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::__tree_node<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, void*>*, long>, bool> std::__1::set<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::less<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>>::emplace[abi:v170000]<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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) /msan/cxx_build/include/c++/v1/set:787:29 [#6](/bitcoin-bitcoin/6/) 0x561e02b52504 in CRPCConvertTable::CRPCConvertTable() src/rpc/client.cpp:341:23 [#7](/bitcoin-bitcoin/7/) 0x561e02b52504 in __cxx_global_var_init.222 src/rpc/client.cpp:345:25 [#8](/bitcoin-bitcoin/8/) 0x561e02b52504 in _GLOBAL__sub_I_client.cpp src/rpc/client.cpp [#9](/bitcoin-bitcoin/9/) 0x7f37ebc51eba in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29eba) (BuildId: 229b7dc509053fe4df5e29e8629911f0c3bc66dd) SUMMARY: MemorySanitizer: use-of-uninitialized-value src/test/fuzz/fuzz.cpp:48:5 in SetArgs(int, char**) Exiting -
Yugthakkar04 commented at 4:36 PM on September 19, 2023: none
All changes are done perfectly just work upon the security procedure once
-
maflcko commented at 9:05 AM on September 20, 2023: member
Took another look, and this has something to do with dropping
-DLIBCXX_ENABLE_DEBUG_MODE=ONLocally, the same problem happens on 16.0.6 when dropping
-DLIBCXX_ENABLE_DEBUG_MODE=ON.:thinking:
- Retropex referenced this in commit d5534eba60 on Oct 4, 2023
- fanquake referenced this in commit 5b9831a0a5 on Mar 20, 2024
- bitcoin locked this on Sep 19, 2024