ctest -C Debug fails on vs2022 (miniscript_tests (SEGFAULT)) #32341

issue maflcko openend this issue on April 24, 2025
  1. maflcko commented at 5:25 pm on April 24, 2025: member

    cmd: ctest --output-on-failure --stop-on-failure -j $NUMBER_OF_PROCESSORS -C Debug

    The full log and config is in the comment below: #32341 (comment). Which was motivated by #32339 attempting to use a windows debug build.

  2. maflcko added the label Windows on Apr 24, 2025
  3. maflcko added the label Tests on Apr 24, 2025
  4. maflcko renamed this:
    ctest -C Debug fails on vs2022 with test_bitcoin-qt (Exit code 0xc0000135)
    ctest -C Debug fails on vs2022 (Exit code 0xc0000135)
    on Apr 24, 2025
  5. maflcko closed this on Apr 24, 2025

  6. hebasto commented at 9:05 pm on April 24, 2025: member

    FWIW, here is the demo branch where the native Windows CI job has been switched to the “Debug” configuration.

    CI logs: https://github.com/hebasto/bitcoin/actions/runs/14650416249.

  7. maflcko commented at 5:54 am on April 25, 2025: member

    Thx. Though, now it says:

    0The following tests FAILED:
    1	 60 - miniscript_tests (SEGFAULT)
    2Errors while running CTest
    

    This raises two questions:

    • I’d say for the CI we want to reset /Ob0 /Od back to /O2 /Ob1 to avoid slowness.
    • I guess this is not really a segfault/bug in the code, but rather a stack overflow, due to the debug config eating more memory?
  8. hebasto commented at 6:40 am on April 25, 2025: member

    Thx. Though, now it says:

    0The following tests FAILED:
    1	 60 - miniscript_tests (SEGFAULT)
    2Errors while running CTest
    
    • I guess this is not really a segfault/bug in the code, but rather a stack overflow, due to the debug config eating more memory?

    I’m not sure. I can reproduce the issue locally and it refers to an exception:

    0    Start 58: miniscript_tests
    11/1 Test [#58](/bitcoin-bitcoin/58/): miniscript_tests .................***Exception: SegFault 51.83 sec
    

    Will try to narrow it down.

  9. maflcko commented at 7:51 am on April 25, 2025: member
    A third question would be, why the fuzz output is https://github.com/hebasto/bitcoin/actions/runs/14650416249/job/41114604643#step:14:60: subprocess timed out: Currently only libFuzzer is supported. A timeout should not happen for this process call, and the expected outcome should be an immediate stderr of test/fuzz/fuzz.cpp:269 main: Assertion 'read_file(input_path, buffer)' failed. Error processing input "-help=1" and an ignored exit code.
  10. maflcko renamed this:
    ctest -C Debug fails on vs2022 (Exit code 0xc0000135)
    ctest -C Debug fails on vs2022 (miniscript_tests (SEGFAULT))
    on Apr 25, 2025
  11. fanquake commented at 8:46 am on April 25, 2025: member
    Re-opening, given it looks like there are at least two cmake/windows bugs here?
  12. fanquake reopened this on Apr 25, 2025

  13. hebasto commented at 12:43 pm on April 25, 2025: member

    Thx. Though, now it says:

    0The following tests FAILED:
    1	 60 - miniscript_tests (SEGFAULT)
    2Errors while running CTest
    
    • I guess this is not really a segfault/bug in the code, but rather a stack overflow, due to the debug config eating more memory?

    Fixed in #32349.

  14. l0rinc referenced this in commit bd89f7eff0 on Apr 25, 2025
  15. hodlinator commented at 10:05 pm on April 26, 2025: contributor
    Was curious how this issue was introduced. Seems like it’s existed for some time but was found by #32339 momentarily switching some Windows CI to use Debug configs. Would it be worth adding to the description instead of just “ref: #32339”?
  16. l0rinc referenced this in commit 28f7f3f58d on Apr 27, 2025
  17. fanquake commented at 9:26 am on April 28, 2025: member

    but was found by #32339 momentarily

    It was actually first pointed out here, #31367 (comment), by @dergoegge.

  18. maflcko commented at 9:35 am on April 28, 2025: member

    I’d say for the CI we want to reset /Ob0 /Od back to /O2 /Ob1 to avoid slowness. @hebasto If you don’t mind, could you update your CI branch with this. If not, that’s fine also and I’ll try it myself.

  19. hebasto commented at 9:45 am on April 28, 2025: member

    I’d say for the CI we want to reset /Ob0 /Od back to /O2 /Ob1 to avoid slowness.

    @hebasto If you don’t mind, could you update your CI branch with this. If not, that’s fine also and I’ll try it myself.

    Will do.

  20. hebasto commented at 10:41 am on April 28, 2025: member

    I’d say for the CI we want to reset /Ob0 /Od back to /O2 /Ob1 to avoid slowness.

    @hebasto If you don’t mind, could you update your CI branch with this. If not, that’s fine also and I’ll try it myself.

    https://github.com/hebasto/bitcoin-core-nightly/actions/runs/14705754388/job/41265724818 https://github.com/hebasto/bitcoin-core-nightly/actions/runs/14707592382/job/41271542519

  21. l0rinc referenced this in commit b80d0bdee4 on Apr 28, 2025
  22. achow101 referenced this in commit 2d5b424414 on Apr 29, 2025
  23. achow101 closed this on Apr 29, 2025

  24. maflcko commented at 5:17 pm on April 30, 2025: member

    A third question would be, why the fuzz output is https://github.com/hebasto/bitcoin/actions/runs/14650416249/job/41114604643#step:14:60: subprocess timed out: Currently only libFuzzer is supported. A timeout should not happen for this process call, and the expected outcome should be an immediate stderr of test/fuzz/fuzz.cpp:269 main: Assertion 'read_file(input_path, buffer)' failed. Error processing input "-help=1" and an ignored exit code.

    Looks like the assertions fails, but the program never prints anything, or aborts:

    https://github.com/maflcko/bitcoin-core-with-ci/actions/runs/14759346479/job/41435857332#step:13:58

    0
    1Run "$BITCOINFUZZ" -help=1
    2Wed, 30 Apr 2025 16:36:03 GMT D:\a\bitcoin-core-with-ci\bitcoin-core-with-ci\src\test\fuzz\fuzz.cpp:269 main: Assertion `read_file(input_path, buffer)' failed.
    3Wed, 30 Apr 2025 17:02:52 GMT Error: The operation was canceled.
    

    I guess this means the std::signal(SIGABRT, signal_handler) does something different.

    Possibly a debugger is automatically attached?

  25. AlnetharyT referenced this in commit 5a1669f648 on May 2, 2025
  26. hebasto commented at 6:43 pm on May 2, 2025: member

    A third question would be, why the fuzz output is https://github.com/hebasto/bitcoin/actions/runs/14650416249/job/41114604643#step:14:60: subprocess timed out: Currently only libFuzzer is supported. A timeout should not happen for this process call, and the expected outcome should be an immediate stderr of test/fuzz/fuzz.cpp:269 main: Assertion 'read_file(input_path, buffer)' failed. Error processing input "-help=1" and an ignored exit code.

    Looks like the assertions fails, but the program never prints anything, or aborts:

    https://github.com/maflcko/bitcoin-core-with-ci/actions/runs/14759346479/job/41435857332#step:13:58

    0
    1Run "$BITCOINFUZZ" -help=1
    2Wed, 30 Apr 2025 16:36:03 GMT D:\a\bitcoin-core-with-ci\bitcoin-core-with-ci\src\test\fuzz\fuzz.cpp:269 main: Assertion `read_file(input_path, buffer)' failed.
    3Wed, 30 Apr 2025 17:02:52 GMT Error: The operation was canceled.
    

    I guess this means the std::signal(SIGABRT, signal_handler) does something different.

    Possibly a debugger is automatically attached?

    It is actually a message box:

    Image

    The following patch helps:

    0--- a/src/test/fuzz/fuzz.cpp
    1+++ b/src/test/fuzz/fuzz.cpp
    2@@ -245,6 +245,7 @@ int main(int argc, char** argv)
    3         test_one_input(buffer);
    4         return 0;
    5     }
    6+    _set_abort_behavior(0, _WRITE_ABORT_MSG);
    7     std::signal(SIGABRT, signal_handler);
    8     const auto start_time{Now<SteadySeconds>()};
    9     int tested = 0;
    

    For more details, see Microsoft docs:


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

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