tests: Update valgrind suppressions #17455

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:valgrind-suppressions changing 1 files +70 −1
  1. practicalswift commented at 6:43 pm on November 12, 2019: contributor

    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
    
  2. fanquake added the label Tests on Nov 12, 2019
  3. MarcoFalke commented at 7:12 pm on November 12, 2019: member

    Some notes:

    • Would be nice to explain how to generate suppressions
    • Does it make sense to move it to ./test, like the other suppressions?
    • Does the list depend on OS/library versions?

    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...
    
  4. MarcoFalke commented at 7:34 pm on November 12, 2019: member
    Oh, and for a follow-up: The leveldb suppressions should be removed after #17398
  5. practicalswift force-pushed on Nov 12, 2019
  6. in contrib/valgrind.supp:57 in 4cce3628cf outdated
    52+   fun:wcsnrtombs
    53+   ...
    54+   fun:_ZN5boost10filesystem6detail11unique_pathERKNS0_4pathEPNS_6system10error_codeE
    55+}
    56+{
    57+   Suppress boost::filesystem warning
    


    MarcoFalke commented at 8:13 pm on November 12, 2019:
    0   Suppress boost::filesystem warning. Fixed in boost 1.70 (https://github.com/boostorg/filesystem/commit/bbe9d1771e5d679b3f10c42a58fc81f7e8c024a9)
    
  7. in contrib/valgrind.supp:81 in 4cce3628cf outdated
    72+   Memcheck:Leak
    73+   match-leak-kinds: reachable
    74+   fun:_Znwm
    75+   fun:_Z11LogInstancev
    76+   ...
    77+   fun:SeedInsecureRand
    


    MarcoFalke commented at 8:15 pm on November 12, 2019:
    What is the issue? This should be fixed.

    MarcoFalke commented at 8:33 pm on November 12, 2019:
    I guess the issue is generally with LogInstance and not SeedInsecureRand?

    practicalswift commented at 8:49 pm on November 12, 2019:
    True! Fixed! :)
  8. in contrib/valgrind.supp:11 in 4cce3628cf outdated
     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.
    


    MarcoFalke commented at 8:32 pm on November 12, 2019:

    Why not

    0--leak-check=full --show-reachable=yes --error-limit=no --gen-suppressions=all --suppressions=the_current_file
    

    ?

  9. in contrib/valgrind.supp:67 in 4cce3628cf outdated
    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
    


    MarcoFalke commented at 8:34 pm on November 12, 2019:
    I couldn’t find a fix or bug report for this

    practicalswift commented at 8:54 pm on November 12, 2019:

    Me neither.

    I created the suppressions on a plain Ubuntu 18.04.2 LTS machine. As non-exotic as it gets :)


    practicalswift commented at 8:59 pm on November 12, 2019:

    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}
    

  10. in contrib/valgrind.supp:52 in 4cce3628cf outdated
    44@@ -41,3 +45,34 @@
    45    ...
    46    fun:_ZN7leveldbL14InitDefaultEnvEv
    47 }
    48+{
    49+   Suppress boost::filesystem warning
    


    MarcoFalke commented at 8:34 pm on November 12, 2019:
    Is there a fix or bug report for this?

    practicalswift commented at 8:55 pm on November 12, 2019:

    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 :)


    practicalswift commented at 10:05 pm on November 12, 2019:

    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}
    

    practicalswift commented at 10:18 pm on November 12, 2019:
    Added reference to related issue.
  11. practicalswift force-pushed on Nov 12, 2019
  12. in contrib/valgrind.supp:15 in 4f1af43501 outdated
     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
    


    MarcoFalke commented at 8:47 pm on November 12, 2019:

    This will be very verbose and makes it hard to spot suppressions

    0#        src/test/test_bitcoin
    
  13. practicalswift force-pushed on Nov 12, 2019
  14. practicalswift force-pushed on Nov 12, 2019
  15. practicalswift force-pushed on Nov 12, 2019
  16. practicalswift force-pushed on Nov 12, 2019
  17. practicalswift commented at 9:12 pm on November 12, 2019: contributor

    @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? :)

  18. practicalswift force-pushed on Nov 12, 2019
  19. practicalswift force-pushed on Nov 13, 2019
  20. tests: Update valgrind suppressions d604b4cc8c
  21. practicalswift force-pushed on Nov 13, 2019
  22. practicalswift commented at 10:38 am on November 14, 2019: contributor
    • 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.

  23. MarcoFalke referenced this in commit 1ed3e071df on Nov 15, 2019
  24. MarcoFalke merged this on Nov 15, 2019
  25. MarcoFalke closed this on Nov 15, 2019

  26. practicalswift deleted the branch on Apr 10, 2021
  27. Munkybooty referenced this in commit 49e3ea7fba on May 23, 2022
  28. Munkybooty referenced this in commit cfaca4ba8a on May 23, 2022
  29. Munkybooty referenced this in commit 721c3cb6cd on May 23, 2022
  30. Munkybooty referenced this in commit 9b1065ae83 on May 30, 2022
  31. Munkybooty referenced this in commit 591711d119 on Jun 7, 2022
  32. Munkybooty referenced this in commit 6c6cdba9ed on Jun 8, 2022
  33. Munkybooty referenced this in commit 0ca28b5f89 on Jun 16, 2022
  34. Munkybooty referenced this in commit 16d2ad19d8 on Jun 21, 2022
  35. Munkybooty referenced this in commit e999f145bf on Jun 21, 2022
  36. Munkybooty referenced this in commit fd5b2c24dc on Jul 6, 2022
  37. Munkybooty referenced this in commit 86325d0cbf on Aug 3, 2022
  38. Munkybooty referenced this in commit e77b620d82 on Aug 16, 2022
  39. DrahtBot locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-19 00:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me