Update valgrind
suppressions.
To test this PR:
0$ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin
1$ valgrind --suppressions=contrib/valgrind.supp src/bench/bench_bitcoin -evals=1 \
2 -scaling=0.0
Update valgrind
suppressions.
To test this PR:
0$ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin
1$ valgrind --suppressions=contrib/valgrind.supp src/bench/bench_bitcoin -evals=1 \
2 -scaling=0.0
Some notes:
./test
, like the other suppressions?I get these errors:
0$ valgrind --leak-check=full --show-reachable=yes --error-limit=no --gen-suppressions=all --suppressions=./contrib/valgrind.supp ./src/test/test_bitcoin -t merkle_tests
1==32499== Memcheck, a memory error detector
2==32499== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
3==32499== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
4==32499== Command: ./src/test/test_bitcoin -t merkle_tests
5==32499==
6Running 6 test cases...
7==32499== Conditional jump or move depends on uninitialised value(s)
8==32499== at 0x48806CD: boost::filesystem::detail::directory_iterator_increment(boost::filesystem::directory_iterator&, boost::system::error_code*) (in /usr/lib64/libboost_filesystem.so.1.69.0)
9==32499== by 0x4880D0A: boost::filesystem::detail::directory_iterator_construct(boost::filesystem::directory_iterator&, boost::filesystem::path const&, boost::system::error_code*) (in /usr/lib64/libboost_filesystem.so.1.69.0)
10==32499== by 0x48814D6: ??? (in /usr/lib64/libboost_filesystem.so.1.69.0)
11==32499== by 0x488181E: boost::filesystem::detail::remove_all(boost::filesystem::path const&, boost::system::error_code*) (in /usr/lib64/libboost_filesystem.so.1.69.0)
12==32499== by 0x27CA1F: remove_all (operations.hpp:673)
13==32499== by 0x27CA1F: BasicTestingSetup::~BasicTestingSetup() (setup_common.cpp:93)
14==32499== by 0x27EBF1: TestingSetup::~TestingSetup() (setup_common.cpp:138)
15==32499== by 0x425CC7: ~merkle_test (merkle_tests.cpp:183)
16==32499== by 0x425CC7: merkle_tests::merkle_test_invoker() (merkle_tests.cpp:183)
17==32499== by 0x4920581: ??? (in /usr/lib64/libboost_unit_test_framework.so.1.69.0)
18==32499== by 0x491F5EC: boost::execution_monitor::catch_signals(boost::function<int ()> const&) (in /usr/lib64/libboost_unit_test_framework.so.1.69.0)
19==32499== by 0x491F677: boost::execution_monitor::execute(boost::function<int ()> const&) (in /usr/lib64/libboost_unit_test_framework.so.1.69.0)
20==32499== by 0x491F74D: boost::execution_monitor::vexecute(boost::function<void ()> const&) (in /usr/lib64/libboost_unit_test_framework.so.1.69.0)
21==32499== by 0x494A24E: boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned int) (in /usr/lib64/libboost_unit_test_framework.so.1.69.0)
22==32499==
23{
24 <insert_a_suppression_name_here>
25 Memcheck:Cond
26 fun:_ZN5boost10filesystem6detail28directory_iterator_incrementERNS0_18directory_iteratorEPNS_6system10error_codeE
27 fun:_ZN5boost10filesystem6detail28directory_iterator_constructERNS0_18directory_iteratorERKNS0_4pathEPNS_6system10error_codeE
28 obj:/usr/lib64/libboost_filesystem.so.1.69.0
29 fun:_ZN5boost10filesystem6detail10remove_allERKNS0_4pathEPNS_6system10error_codeE
30 fun:remove_all
31 fun:_ZN17BasicTestingSetupD1Ev
32 fun:_ZN12TestingSetupD1Ev
33 fun:~merkle_test
34 fun:_ZN12merkle_testsL19merkle_test_invokerEv
35 obj:/usr/lib64/libboost_unit_test_framework.so.1.69.0
36 fun:_ZN5boost17execution_monitor13catch_signalsERKNS_8functionIFivEEE
37 fun:_ZN5boost17execution_monitor7executeERKNS_8functionIFivEEE
38 fun:_ZN5boost17execution_monitor8vexecuteERKNS_8functionIFvvEEE
39 fun:_ZN5boost9unit_test19unit_test_monitor_t21execute_and_translateERKNS_8functionIFvvEEEj
40}
41...
52+ fun:wcsnrtombs
53+ ...
54+ fun:_ZN5boost10filesystem6detail11unique_pathERKNS0_4pathEPNS_6system10error_codeE
55+}
56+{
57+ Suppress boost::filesystem warning
0 Suppress boost::filesystem warning. Fixed in boost 1.70 (https://github.com/boostorg/filesystem/commit/bbe9d1771e5d679b3f10c42a58fc81f7e8c024a9)
72+ Memcheck:Leak
73+ match-leak-kinds: reachable
74+ fun:_Znwm
75+ fun:_Z11LogInstancev
76+ ...
77+ fun:SeedInsecureRand
LogInstance
and not SeedInsecureRand
?
6@@ -7,6 +7,10 @@
7 # $ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin
8 # $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \
9 # --show-leak-kinds=all src/test/test_bitcoin --log_level=test_suite
10+#
11+# To create suppressions for found issues, use the --gen-suppressions=all option.
Why not
0--leak-check=full --show-reachable=yes --error-limit=no --gen-suppressions=all --suppressions=the_current_file
?
59+ fun:_ZN5boost10filesystem6detail28directory_iterator_incrementERNS0_18directory_iteratorEPNS_6system10error_codeE
60+ fun:_ZN5boost10filesystem6detail28directory_iterator_constructERNS0_18directory_iteratorERKNS0_4pathEPNS_6system10error_codeE
61+ obj:*/libboost_filesystem.so.*
62+}
63+{
64+ Suppress boost::filesystem warning
Me neither.
I created the suppressions on a plain Ubuntu 18.04.2 LTS machine. As non-exotic as it gets :)
This is the full output:
0==7373== 51 bytes in 1 blocks are still reachable in loss record 2 of 6
1==7373== at 0x4C3017F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
2==7373== by 0x504AAC9: boost::filesystem::absolute(boost::filesystem::path const&, boost::filesystem::path const&) (in /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1)
3==7373== by 0x90A6D2: AbsPathForConfigVal(boost::filesystem::path const&, bool) (system.cpp:1126)
4==7373== by 0x6B9937: InitLogging() (init.cpp:827)
5==7373== by 0x18A712: BasicTestingSetup::BasicTestingSetup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (setup_common.cpp:74)
6==7373== by 0x18A96B: TestingSetup::TestingSetup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (setup_common.cpp:97)
7==7373== by 0x3218CC: merkle_test_BlockWitness (merkle_tests.cpp:330)
8==7373== by 0x3218CC: merkle_tests::merkle_test_BlockWitness_invoker() (merkle_tests.cpp:330)
9==7373== by 0x58EF2CD: boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
10==7373== by 0x58EE77C: boost::execution_monitor::catch_signals(boost::function<int ()> const&) (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
11==7373== by 0x58EE860: boost::execution_monitor::execute(boost::function<int ()> const&) (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
12==7373== by 0x58EEFDC: boost::execution_monitor::vexecute(boost::function<void ()> const&) (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
13==7373== by 0x591D8D0: boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned int) (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
14==7373==
15{
16 <insert_a_suppression_name_here>
17 Memcheck:Leak
18 match-leak-kinds: reachable
19 fun:_Znwm
20 fun:_ZN5boost10filesystem8absoluteERKNS0_4pathES3_
21 fun:_Z19AbsPathForConfigValRKN5boost10filesystem4pathEb
22 fun:_Z11InitLoggingv
23 fun:_ZN17BasicTestingSetupC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
24 fun:_ZN12TestingSetupC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
25 fun:merkle_test_BlockWitness
26 fun:_ZN12merkle_testsL32merkle_test_BlockWitness_invokerEv
27 fun:_ZN5boost6detail8function21function_obj_invoker0INS0_7forwardEiE6invokeERNS1_15function_bufferE
28 fun:_ZN5boost17execution_monitor13catch_signalsERKNS_8functionIFivEEE
29 fun:_ZN5boost17execution_monitor7executeERKNS_8functionIFivEEE
30 fun:_ZN5boost17execution_monitor8vexecuteERKNS_8functionIFvvEEE
31 fun:_ZN5boost9unit_test19unit_test_monitor_t21execute_and_translateERKNS_8functionIFvvEEEj
32}
44@@ -41,3 +45,34 @@
45 ...
46 fun:_ZN7leveldbL14InitDefaultEnvEv
47 }
48+{
49+ Suppress boost::filesystem warning
Not that I’ve been able to find.
I created the suppressions on a plain Ubuntu 18.04.2 LTS machine. As non-exotic as it gets :)
Full output:
0==29772== Invalid read of size 16
1==29772== at 0x7712ABD: __wcsnlen_sse4_1 (strlen.S:194)
2==29772== by 0x7700458: wcsnrtombs (wcsnrtombs.c:58)
3==29772== by 0x6DB2E6D: std::codecvt<wchar_t, char, __mbstate_t>::do_out(__mbstate_t&, wchar_t const*, wchar_t const*, wchar_t const*&, char*, char*, char*&) const (in /usr/lib/x86_64-linux-g
4nu/libstdc++.so.6.0.25)
5==29772== by 0x50551B1: boost::filesystem::path_traits::convert(wchar_t const*, wchar_t const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::codecvt<
6wchar_t, char, __mbstate_t> const&) (in /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1)
7==29772== by 0x505563A: boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*) (in /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1)
8==29772== by 0x904E75: unique_path (operations.hpp:723)
9==29772== by 0x904E75: DirIsWritable(boost::filesystem::path const&) (system.cpp:122)
10==29772== by 0x4CE8A0: util_tests::test_DirIsWritable::test_method() (util_tests.cpp:1613)
11==29772== by 0x4CEF98: util_tests::test_DirIsWritable_invoker() (util_tests.cpp:1601)
12==29772== by 0x58EF2CD: boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) (in /usr/lib/x86_64-linux-gnu/libboost_u
13nit_test_framework.so.1.65.1)
14==29772== by 0x58EE77C: boost::execution_monitor::catch_signals(boost::function<int ()> const&) (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
15==29772== by 0x58EE860: boost::execution_monitor::execute(boost::function<int ()> const&) (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
16==29772== by 0x58EEFDC: boost::execution_monitor::vexecute(boost::function<void ()> const&) (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
17==29772== Address 0x12b82050 is 0 bytes after a block of size 80 alloc'd
18==29772== at 0x4C3017F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
19==29772== by 0x6E3BCAA: std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_mutate(unsigned long, unsigned long, wchar_t const*, unsigned long) (in /u
20sr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25)
21==29772== by 0x6E3CB02: std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_replace(unsigned long, unsigned long, wchar_t const*, unsigned long) (in /
22usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25) ==29772== by 0x5054F11: boost::filesystem::path_traits::convert(char const*, char const*, std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >&, std::codec
23vt<wchar_t, char, __mbstate_t> const&) (in /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1)
24==29772== by 0x50556F7: boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*) (in /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1)
25==29772== by 0x904E75: unique_path (operations.hpp:723)
26==29772== by 0x904E75: DirIsWritable(boost::filesystem::path const&) (system.cpp:122)
27==29772== by 0x4CE8A0: util_tests::test_DirIsWritable::test_method() (util_tests.cpp:1613)
28==29772== by 0x4CEF98: util_tests::test_DirIsWritable_invoker() (util_tests.cpp:1601)
29==29772== by 0x58EF2CD: boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) (in /usr/lib/x86_64-linux-gnu/libboost_u
30nit_test_framework.so.1.65.1)
31==29772== by 0x58EE77C: boost::execution_monitor::catch_signals(boost::function<int ()> const&) (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
32==29772== by 0x58EE860: boost::execution_monitor::execute(boost::function<int ()> const&) (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
33==29772== by 0x58EEFDC: boost::execution_monitor::vexecute(boost::function<void ()> const&) (in /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1)
34==29772==
35{
36 <insert_a_suppression_name_here>
37 Memcheck:Addr16
38 fun:__wcsnlen_sse4_1
39 fun:wcsnrtombs
40 fun:_ZNKSt7codecvtIwc11__mbstate_tE6do_outERS0_PKwS4_RS4_PcS6_RS6_
41 fun:_ZN5boost10filesystem11path_traits7convertEPKwS3_RNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt7codecvtIwc11__mbstate_tE
42 fun:_ZN5boost10filesystem6detail11unique_pathERKNS0_4pathEPNS_6system10error_codeE
43 fun:unique_path
44 fun:_Z13DirIsWritableRKN5boost10filesystem4pathE
45 fun:_ZN10util_tests18test_DirIsWritable11test_methodEv
46 fun:_ZN10util_testsL26test_DirIsWritable_invokerEv
47 fun:_ZN5boost6detail8function21function_obj_invoker0INS0_7forwardEiE6invokeERNS1_15function_bufferE
48 fun:_ZN5boost17execution_monitor13catch_signalsERKNS_8functionIFivEEE
49 fun:_ZN5boost17execution_monitor7executeERKNS_8functionIFivEEE
50 fun:_ZN5boost17execution_monitor8vexecuteERKNS_8functionIFvvEEE
51}
6@@ -7,6 +7,14 @@
7 # $ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin
8 # $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \
9 # --show-leak-kinds=all src/test/test_bitcoin --log_level=test_suite
10+#
11+# To create suppressions for found issues, use the --gen-suppressions=all option:
12+# $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \
13+# --show-leak-kinds=all --gen-suppressions=all --show-reachable=yes \
14+# --error-limit=no --gen-suppressions=all \
15+# src/test/test_bitcoin --log_level=test_suite
This will be very verbose and makes it hard to spot suppressions
0# src/test/test_bitcoin
@MarcoFalke Could you re-run …
0$ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin
1$ valgrind --suppressions=contrib/valgrind.supp src/bench/bench_bitcoin -evals=1 \
2 -scaling=0.0
… on your system with the updated suppressions and see if it passes without warnings? :)
- Would be nice to explain how to generate suppressions
Documentation added.
- Does it make sense to move it to
./test
, like the other suppressions?
Sure! Do you have any suggestion on where under test/
to put it?
- Does the list depend on OS/library versions?
Documentation added.
I get these errors:
Suppressions added.
Labels
Tests