fuzz: Print error message when FUZZ is missing #27672

pull maflcko wants to merge 2 commits into bitcoin:master from maflcko:2305-fuzz-log-FUZZ- changing 3 files +27 −7
  1. maflcko commented at 11:02 AM on May 16, 2023: member

    Some trivial UX improvements.

    • Change the exit code for PRINT_ALL_FUZZ_TARGETS_AND_ABORT and WRITE_ALL_FUZZ_TARGETS_AND_ABORT to EXIT_SUCCESS instead of Aborted (core dumped).
    • Print readable error message when FUZZ is missing instead of Aborted (core dumped).
    • Clarify that a fuzz target needs to be compiled into the executable.
  2. DrahtBot commented at 11:02 AM on May 16, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK dergoegge

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

  3. DrahtBot added the label Tests on May 16, 2023
  4. maflcko commented at 11:03 AM on May 16, 2023: member

    (Also contains some no-op code to allow for easier hacking)

  5. fanquake requested review from dergoegge on May 16, 2023
  6. maflcko force-pushed on May 17, 2023
  7. maflcko force-pushed on May 17, 2023
  8. DrahtBot added the label CI failed on May 17, 2023
  9. DrahtBot removed the label CI failed on May 17, 2023
  10. in src/test/fuzz/fuzz.cpp:110 in fac80580a3 outdated
     106 | +    if (const auto* env_fuzz{std::getenv("FUZZ")}) {
     107 | +        // To allow for easier fuzz executable binary modification,
     108 | +        static std::string g_copy{env_fuzz}; // create copy to avoid compiler optimizations, and
     109 | +        g_fuzz_target = g_copy.c_str();      // strip string after the first null-char.
     110 | +    } else {
     111 | +        std::cerr << "Must select fuzz target with the FUZZ env var." << std::endl;
    


    dergoegge commented at 8:23 AM on May 18, 2023:

    nit: Would it be good to hint at PRINT_ALL_FUZZ_TARGETS_AND_ABORT=1 in the message?


    maflcko commented at 10:19 AM on May 18, 2023:

    Thx, done

  11. dergoegge commented at 8:24 AM on May 18, 2023: member

    Concept ACK

  12. maflcko force-pushed on May 18, 2023
  13. fuzz: Print error message when FUZZ is missing
    Also, add missing includes.
    fa22966f33
  14. ci: Log qa-assets repo last commit
    This documents the state in the CI output and may help debugging in case
    of failure.
    fa1b3abc83
  15. maflcko force-pushed on May 22, 2023
  16. DrahtBot added the label CI failed on May 22, 2023
  17. DrahtBot removed the label CI failed on May 22, 2023
  18. maflcko commented at 9:20 AM on May 22, 2023: member

    Added a commit to also improve fuzz logging in the CI system: https://cirrus-ci.com/task/4987695903014912?logs=ci#L222

  19. dergoegge commented at 10:38 AM on May 22, 2023: member

    ACK fa1b3abc834a90fb1cfbd5ac63deb28f3990c1fb

  20. fanquake merged this on May 22, 2023
  21. fanquake closed this on May 22, 2023

  22. maflcko deleted the branch on May 22, 2023
  23. sidhujag referenced this in commit c434df6391 on May 23, 2023
  24. bitcoin locked this on May 21, 2024
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-24 06:14 UTC

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