build: run constant-time tests in both test suites #1944

pull Yudis-bit wants to merge 2 commits into bitcoin-core:master from Yudis-bit:cmake-run-constant-time-tests changing 8 files +61 −11
  1. Yudis-bit commented at 10:15 AM on September 27, 2026: contributor

    Both build systems can build ctime_tests without running it as part of the test suite. Add it to CTest and Autotools make check.

    Run the test directly when MemorySanitizer is enabled, or under Valgrind with --error-exitcode=42. For Valgrind builds, omit registration with a configure-time message if the executable is unavailable or the build is cross-compiled. Document the existing opt-outs and the commands for running the test separately.

    The Autotools test uses its own shell runner so a global LOG_COMPILER does not wrap Valgrind a second time. Remove the separate invocation from ci/ci.sh now that make check runs it.

    Addresses #1560.

    Tested on x86_64 Linux (WSL1), with GCC 15.2.0, Clang 21.1.8 and Valgrind 3.26.0:

    • All 4 Autotools tests and all 226 CTest tests pass with the default module configuration.
    • The Autotools MSan build runs the test directly and passes with Valgrind installed. The dedicated runner also works with LOG_COMPILER=false.
    • A temporary branch on poisoned secret data makes both make check and CTest fail under Valgrind. Both pass after restoring the source.
    • Autotools registration checked with constant-time tests disabled, Valgrind support disabled, the executable lookup forced empty, and a simulated cross-compilation configuration using the host GCC.
    • make distcheck DISTCHECK_CONFIGURE_FLAGS="--disable-tests --disable-exhaustive-tests --disable-benchmark" passes, including the constant-time test in the distributed source. Used bsdtar because the system GNU tar fails to extract archives on this WSL1 kernel.
  2. cmake: run constant-time tests with CTest 00ff182cab
  3. Yudis-bit requested review from Copilot on Sep 27, 2026
  4. Copilot commented at 10:15 AM on September 27, 2026: none

    Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

  5. hebasto commented at 3:22 PM on September 27, 2026: member

    Addresses the CMake part of #1560. Autotools integration remains separate.

    I'd prefer to modify both build systems at the same time.

  6. autotools: run constant-time tests in make check
    Run ctime_tests through a shell test with its own runner so LOG_COMPILER
    does not wrap it a second time in CI. Prefer MSan when enabled; otherwise
    use Valgrind with --error-exitcode=42 for native builds when available.
    
    Remove the separate CI invocation now that make check covers it, and
    document how to run or disable the test.
    93b2cc9e45
  7. Yudis-bit renamed this:
    cmake: run constant-time tests with CTest
    build: run constant-time tests in both test suites
    on Sep 27, 2026
  8. Yudis-bit commented at 3:54 PM on September 27, 2026: contributor

    @hebasto Added Autotools support in 93b2cc9. make check now runs the constant-time test under Valgrind, or directly for MSan builds. I also removed the separate CI invocation.

    Both test suites pass. A temporary branch on poisoned secret data makes both fail; they pass again after restoring the source.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-09-28 09:33 UTC