[fuzz] Avoid partial negative result #29462

pull murchandamus wants to merge 1 commits into bitcoin:master from murchandamus:2024-02-fix-coingrinder-optimality-fuzz changing 1 files +1 −1
  1. murchandamus commented at 8:53 PM on February 21, 2024: contributor

    May address the problem reported by maflcko in #27877#pullrequestreview-1890304914.

    For some values, MAX_MONEY - max_spendable - max_output_groups could result in a partial negative value. By putting the addition of group_pos.size() first, all partial results in this line will be strictly positive.

    I opened this as a draft, since I was unable to reproduce the issue, so I’m waiting for confirmation whether this in fact mitigates the problem.

  2. [fuzz] Avoid partial negative result 9dae3b970a
  3. DrahtBot commented at 8:53 PM on February 21, 2024: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK maflcko, sipa, brunoerg, achow101

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

  4. murchandamus commented at 9:40 PM on February 21, 2024: contributor

    Opening for review: After @achow101 pointed out that I needed to enable the "integer" fuzz sanitizer, I was able to reproduce the issue and verify that the proposed fix mitigates the problem.

  5. murchandamus marked this as ready for review on Feb 21, 2024
  6. murchandamus commented at 9:41 PM on February 21, 2024: contributor

    Opening for review: After @achow101 pointed out that I needed to enable the "integer" fuzz sanitizer, I was able to reproduce the issue and verify that the proposed fix mitigates the problem.

  7. achow101 added this to the milestone 27.0 on Feb 21, 2024
  8. maflcko commented at 8:29 AM on February 22, 2024: member

    Tested with:

    ./autogen.sh && CC=clang CXX=clang++ ./configure -q --enable-c++20 --enable-fuzz --with-sanitizers=fuzzer,undefined,integer,float-divide-by-zero && make clean && make
    

    and #27877 (review) to confirm the fix

    ACK 9dae3b970a7a82e8d9f3f755048d427da78c49da

  9. sipa commented at 9:37 AM on February 22, 2024: member

    utACK 9dae3b970a7a82e8d9f3f755048d427da78c49da

  10. brunoerg approved
  11. brunoerg commented at 1:47 PM on February 22, 2024: contributor

    crACK 9dae3b970a7a82e8d9f3f755048d427da78c49da

  12. achow101 commented at 1:59 PM on February 22, 2024: member

    ACK 9dae3b970a7a82e8d9f3f755048d427da78c49da

  13. achow101 merged this on Feb 22, 2024
  14. achow101 closed this on Feb 22, 2024

  15. bitcoin locked this on Feb 21, 2025

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-15 03:13 UTC

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