Commit ff4b609
committed
Sv2: silence MSan warnings
- mark the SHA256 digest returned from Sv2SignatureNoiseMessage::GetHash()
as initialized so MSan stops flagging the certificate hash
- clear the chain name literals and resulting base params object used by
Sv2BasicTestingSetup when selecting regtest
This still fails:
==198==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x55b5ca320949 in basic_string /cxx_build/include/c++/v1/string:1003:9
#1 0x55b5ca320949 in CBaseChainParams /src/sv2-tp/build_fuzz/src/./chainparamsbase.h:29:55
#2 0x55b5ca320949 in std::__1::unique_ptr<CBaseChainParams, std::__1::default_delete<CBaseChainParams>> std::__1::make_unique[abi:de210103]<CBaseChainParams, char const (&) [8], int, int, 0>(char const (&) [8], int&&, int&&) /cxx_build/include/c++/v1/__memory/unique_ptr.h:759:30
#3 0x55b5ca31e66f in CreateBaseChainParams(ChainType) /src/sv2-tp/build_fuzz/src/./chainparamsbase.cpp:48:16
#4 0x55b5ca31dce5 in SelectBaseParams(ChainType) /src/sv2-tp/build_fuzz/src/./chainparamsbase.cpp:55:29
#5 0x55b5ca2e4cad in Sv2BasicTestingSetup::Sv2BasicTestingSetup() /src/sv2-tp/build_fuzz/src/test/fuzz/./test/sv2_test_setup.cpp:34:5
#6 0x55b5ca2c381a in std::__1::unique_ptr<Sv2BasicTestingSetup const, std::__1::default_delete<Sv2BasicTestingSetup const>> std::__1::make_unique[abi:de210103]<Sv2BasicTestingSetup const, 0>() /cxx_build/include/c++/v1/__memory/unique_ptr.h:759:30
#7 0x55b5ca2c339e in (anonymous namespace)::Initialize() /src/sv2-tp/build_fuzz/src/test/fuzz/./test/fuzz/sv2_noise.cpp:32:39
#8 0x55b5ca2ca01d in __invoke<void (*&)()> /cxx_build/include/c++/v1/__type_traits/invoke.h:87:27
#9 0x55b5ca2ca01d in __call<void (*&)()> /cxx_build/include/c++/v1/__type_traits/invoke.h:342:5
#10 0x55b5ca2ca01d in __invoke_r<void, void (*&)()> /cxx_build/include/c++/v1/__type_traits/invoke.h:348:10
#11 0x55b5ca2ca01d in std::__1::__function::__func<void (*)(), void ()>::operator()() /cxx_build/include/c++/v1/__functional/function.h:174:12
#12 0x55b5ca2b9622 in operator() /cxx_build/include/c++/v1/__functional/function.h:274:12
#13 0x55b5ca2b9622 in operator() /cxx_build/include/c++/v1/__functional/function.h:772:10
#14 0x55b5ca2b9622 in initialize /src/sv2-tp/build_fuzz/src/test/fuzz/./test/fuzz/fuzz.cpp:247:5
#15 0x55b5ca2b9622 in LLVMFuzzerInitialize /src/sv2-tp/build_fuzz/src/test/fuzz/./test/fuzz/fuzz.cpp:321:5
#16 0x55b5ca21df42 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:652:5
#17 0x55b5ca24cfa2 in main /llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
#18 0x7f0f188e4082 in __libc_start_main (/tmp/not-out/tmp_tv4p4q7/libc.so.6+0x24082) (BuildId: 5792732f783158c66fb4f3756458ca24e46e827d)
#19 0x55b5ca17802d in _start (/tmp/not-out/tmp_tv4p4q7/sv2_noise_cipher_roundtrip+0x24202d) (BuildId: 4d0ffc8495228d8cab1595a0fea7fa76c40aa18b)
DEDUP_TOKEN: basic_string--CBaseChainParams--std::__1::unique_ptr<CBaseChainParams, std::__1::default_delete<CBaseChainParams>> std::__1::make_unique[abi:de210103]<CBaseChainParams, char const (&) [8], int, int, 0>(char const (&) [8], int&&, int&&)
Uninitialized value was created by an allocation of 'ref.tmp' in the stack frame
#0 0x55b5ca32023c in std::__1::unique_ptr<CBaseChainParams, std::__1::default_delete<CBaseChainParams>> std::__1::make_unique[abi:de210103]<CBaseChainParams, char const (&) [8], int, int, 0>(char const (&) [8], int&&, int&&) /cxx_build/include/c++/v1/__memory/unique_ptr.h:759:34
DEDUP_TOKEN: std::__1::unique_ptr<CBaseChainParams, std::__1::default_delete<CBaseChainParams>> std::__1::make_unique[abi:de210103]<CBaseChainParams, char const (&) [8], int, int, 0>(char const (&) [8], int&&, int&&)
SUMMARY: MemorySanitizer: use-of-uninitialized-value /src/sv2-tp/build_fuzz/src/./chainparamsbase.h:29:55 in CBaseChainParams
Assisted-by: GitHub Copilot
Assisted-by: OpenAI GPT-5-Codex1 parent f60e97d commit ff4b609
2 files changed
+26
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
18 | 33 | | |
19 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
20 | 43 | | |
21 | 44 | | |
22 | 45 | | |
| |||
0 commit comments