fuzz: Abort if system time is called without mock time being set #31549

pull marcofleon wants to merge 2 commits into bitcoin:master from marcofleon:2024/12/fuzz-set-mocktime changing 15 files +57 −3
  1. marcofleon commented at 5:59 pm on December 20, 2024: contributor

    This PR expands the CheckGlobals utility that was introduced in #31486 and should help with fuzz stability (https://github.com/bitcoin/bitcoin/issues/29018).

    System time shouldn’t be used when running a fuzz test, as it is likely to introduce instability (non-determinism). This PR identifies and fixes the targets that were calling system time without setting mock time at the start of an iteration.

    RemovingSetMockTime() from any one of these targets should result in a crash and a message describing the issue.

  2. fuzz: Add SetMockTime() to necessary targets 1a0baae8e8
  3. DrahtBot commented at 6:00 pm on December 20, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31549.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK brunoerg

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #31022 (test: Add mockable steady clock, tests for PCP and NATPMP implementations by laanwj)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  4. DrahtBot added the label Tests on Dec 20, 2024
  5. marcofleon force-pushed on Dec 20, 2024
  6. DrahtBot added the label CI failed on Dec 20, 2024
  7. DrahtBot commented at 6:35 pm on December 20, 2024: contributor

    🚧 At least one of the CI tasks failed. Debug: https://github.com/bitcoin/bitcoin/runs/34723484665

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  8. fuzz: Abort when calling system time without setting mock time 8cf5c4e91c
  9. marcofleon force-pushed on Dec 20, 2024
  10. DrahtBot removed the label CI failed on Dec 20, 2024
  11. brunoerg commented at 9:32 pm on December 20, 2024: contributor
    Concept ACK

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

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