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:

    $ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin
    $ valgrind --suppressions=contrib/valgrind.supp src/bench/bench_bitcoin -evals=1 \
          -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:

    $ valgrind --leak-check=full --show-reachable=yes --error-limit=no --gen-suppressions=all --suppressions=./contrib/valgrind.supp  ./src/test/test_bitcoin -t merkle_tests 
    ==32499== Memcheck, a memory error detector
    ==32499== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
    ==32499== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
    ==32499== Command: ./src/test/test_bitcoin -t merkle_tests
    ==32499== 
    Running 6 test cases...
    ==32499== Conditional jump or move depends on uninitialised value(s)
    ==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)
    ==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)
    ==32499==    by 0x48814D6: ??? (in /usr/lib64/libboost_filesystem.so.1.69.0)
    ==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)
    ==32499==    by 0x27CA1F: remove_all (operations.hpp:673)
    ==32499==    by 0x27CA1F: BasicTestingSetup::~BasicTestingSetup() (setup_common.cpp:93)
    ==32499==    by 0x27EBF1: TestingSetup::~TestingSetup() (setup_common.cpp:138)
    ==32499==    by 0x425CC7: ~merkle_test (merkle_tests.cpp:183)
    ==32499==    by 0x425CC7: merkle_tests::merkle_test_invoker() (merkle_tests.cpp:183)
    ==32499==    by 0x4920581: ??? (in /usr/lib64/libboost_unit_test_framework.so.1.69.0)
    ==32499==    by 0x491F5EC: boost::execution_monitor::catch_signals(boost::function<int ()> const&) (in /usr/lib64/libboost_unit_test_framework.so.1.69.0)
    ==32499==    by 0x491F677: boost::execution_monitor::execute(boost::function<int ()> const&) (in /usr/lib64/libboost_unit_test_framework.so.1.69.0)
    ==32499==    by 0x491F74D: boost::execution_monitor::vexecute(boost::function<void ()> const&) (in /usr/lib64/libboost_unit_test_framework.so.1.69.0)
    ==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)
    ==32499== 
    {
       <insert_a_suppression_name_here>
       Memcheck:Cond
       fun:_ZN5boost10filesystem6detail28directory_iterator_incrementERNS0_18directory_iteratorEPNS_6system10error_codeE
       fun:_ZN5boost10filesystem6detail28directory_iterator_constructERNS0_18directory_iteratorERKNS0_4pathEPNS_6system10error_codeE
       obj:/usr/lib64/libboost_filesystem.so.1.69.0
       fun:_ZN5boost10filesystem6detail10remove_allERKNS0_4pathEPNS_6system10error_codeE
       fun:remove_all
       fun:_ZN17BasicTestingSetupD1Ev
       fun:_ZN12TestingSetupD1Ev
       fun:~merkle_test
       fun:_ZN12merkle_testsL19merkle_test_invokerEv
       obj:/usr/lib64/libboost_unit_test_framework.so.1.69.0
       fun:_ZN5boost17execution_monitor13catch_signalsERKNS_8functionIFivEEE
       fun:_ZN5boost17execution_monitor7executeERKNS_8functionIFivEEE
       fun:_ZN5boost17execution_monitor8vexecuteERKNS_8functionIFvvEEE
       fun:_ZN5boost9unit_test19unit_test_monitor_t21execute_and_translateERKNS_8functionIFvvEEEj
    }
    ...
    
  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:
       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

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

    ==7373== 51 bytes in 1 blocks are still reachable in loss record 2 of 6
    ==7373==    at 0x4C3017F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==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)
    ==7373==    by 0x90A6D2: AbsPathForConfigVal(boost::filesystem::path const&, bool) (system.cpp:1126)
    ==7373==    by 0x6B9937: InitLogging() (init.cpp:827)
    ==7373==    by 0x18A712: BasicTestingSetup::BasicTestingSetup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (setup_common.cpp:74)
    ==7373==    by 0x18A96B: TestingSetup::TestingSetup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (setup_common.cpp:97)
    ==7373==    by 0x3218CC: merkle_test_BlockWitness (merkle_tests.cpp:330)
    ==7373==    by 0x3218CC: merkle_tests::merkle_test_BlockWitness_invoker() (merkle_tests.cpp:330)
    ==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)
    ==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)
    ==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)
    ==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)
    ==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)
    ==7373== 
    {
       <insert_a_suppression_name_here>
       Memcheck:Leak
       match-leak-kinds: reachable
       fun:_Znwm
       fun:_ZN5boost10filesystem8absoluteERKNS0_4pathES3_
       fun:_Z19AbsPathForConfigValRKN5boost10filesystem4pathEb
       fun:_Z11InitLoggingv
       fun:_ZN17BasicTestingSetupC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
       fun:_ZN12TestingSetupC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
       fun:merkle_test_BlockWitness
       fun:_ZN12merkle_testsL32merkle_test_BlockWitness_invokerEv
       fun:_ZN5boost6detail8function21function_obj_invoker0INS0_7forwardEiE6invokeERNS1_15function_bufferE
       fun:_ZN5boost17execution_monitor13catch_signalsERKNS_8functionIFivEEE
       fun:_ZN5boost17execution_monitor7executeERKNS_8functionIFivEEE
       fun:_ZN5boost17execution_monitor8vexecuteERKNS_8functionIFvvEEE
       fun:_ZN5boost9unit_test19unit_test_monitor_t21execute_and_translateERKNS_8functionIFvvEEEj
    }
    

  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:

    ==29772== Invalid read of size 16                                       
    ==29772==    at 0x7712ABD: __wcsnlen_sse4_1 (strlen.S:194)       
    ==29772==    by 0x7700458: wcsnrtombs (wcsnrtombs.c:58)           
    ==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
    nu/libstdc++.so.6.0.25)
    ==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<
    wchar_t, char, __mbstate_t> const&) (in /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1)
    ==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)
    ==29772==    by 0x904E75: unique_path (operations.hpp:723)
    ==29772==    by 0x904E75: DirIsWritable(boost::filesystem::path const&) (system.cpp:122)        
    ==29772==    by 0x4CE8A0: util_tests::test_DirIsWritable::test_method() (util_tests.cpp:1613)
    ==29772==    by 0x4CEF98: util_tests::test_DirIsWritable_invoker() (util_tests.cpp:1601)
    ==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
    nit_test_framework.so.1.65.1)                    
    ==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)
    ==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)
    ==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)
    ==29772==  Address 0x12b82050 is 0 bytes after a block of size 80 alloc'd
    ==29772==    at 0x4C3017F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==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
    sr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25)
    ==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 /
    usr/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
    vt<wchar_t, char, __mbstate_t> const&) (in /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1)
    ==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)
    ==29772==    by 0x904E75: unique_path (operations.hpp:723)
    ==29772==    by 0x904E75: DirIsWritable(boost::filesystem::path const&) (system.cpp:122)
    ==29772==    by 0x4CE8A0: util_tests::test_DirIsWritable::test_method() (util_tests.cpp:1613)
    ==29772==    by 0x4CEF98: util_tests::test_DirIsWritable_invoker() (util_tests.cpp:1601)
    ==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
    nit_test_framework.so.1.65.1)
    ==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)
    ==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)
    ==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)
    ==29772==
    {                                                                                     
       <insert_a_suppression_name_here>
       Memcheck:Addr16                                          
       fun:__wcsnlen_sse4_1         
       fun:wcsnrtombs
       fun:_ZNKSt7codecvtIwc11__mbstate_tE6do_outERS0_PKwS4_RS4_PcS6_RS6_
       fun:_ZN5boost10filesystem11path_traits7convertEPKwS3_RNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt7codecvtIwc11__mbstate_tE
       fun:_ZN5boost10filesystem6detail11unique_pathERKNS0_4pathEPNS_6system10error_codeE
       fun:unique_path
       fun:_Z13DirIsWritableRKN5boost10filesystem4pathE
       fun:_ZN10util_tests18test_DirIsWritable11test_methodEv
       fun:_ZN10util_testsL26test_DirIsWritable_invokerEv
       fun:_ZN5boost6detail8function21function_obj_invoker0INS0_7forwardEiE6invokeERNS1_15function_bufferE
       fun:_ZN5boost17execution_monitor13catch_signalsERKNS_8functionIFivEEE
       fun:_ZN5boost17execution_monitor7executeERKNS_8functionIFivEEE
       fun:_ZN5boost17execution_monitor8vexecuteERKNS_8functionIFvvEEE
    }
    

    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

    #        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 …

    $ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin
    $ valgrind --suppressions=contrib/valgrind.supp src/bench/bench_bitcoin -evals=1 \
          -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
Labels

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: 2026-04-26 09:15 UTC

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