test: Running thread * was not suspended. False leaks are possible. #32542

issue fanquake openend this issue on May 17, 2025
  1. fanquake commented at 10:19 am on May 17, 2025: member

    Related to the discussion in #32538. Our test_bitcoin binary will output this warning when compiled with address sanitzer:

    0# clang version 20.1.3 (Fedora 20.1.3-1.fc43)
    1cmake -B build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSANITIZERS=address
    2cmake --build build
    3./build/bin/test_bitcoin 
    4Running 655 test cases...
    5==72451==Running thread 72090 was not suspended. False leaks are possible.
    6
    7*** No errors detected
    

    However I couldn’t getctest to output the same warning. i.e running:

    0ctest --test-dir build -j20 --extra-verbose --debug | grep "False leaks"
    

    does not produce the same warning.

    If sanitizers are producing warnings, that output should be emitted, if not cause a test failure (if unsuppressed). I’d also think that running ctest vs running test_bitcoin directly, should generally result in the same output, otherwise if sanitizers are producing warnings, or other relevant output, that is currently being “hidden” by ctest.

  2. fanquake added the label Tests on May 17, 2025
  3. hebasto commented at 10:53 am on May 17, 2025: member

    … I’d also think that running ctest vs running test_bitcoin directly, should generally result in the same output, otherwise if sanitizers are producing warnings, or other relevant output, that is currently being “hidden” by ctest.

    cc @purpleKarrot

  4. purpleKarrot commented at 12:53 pm on May 17, 2025: contributor

    CTest is instructed to pass some arguments to test_bitcoin: https://github.com/bitcoin/bitcoin/blob/7710a31f0cb69a04529f39840196826d0b9770ab/src/test/CMakeLists.txt#L193-L195

    Maybe that is the reason? That being said, CTest has builtin support for memory checking using sanitizers.


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: 2025-05-25 18:12 UTC

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