fuzz: Limit wallet_notifications iterations #31238

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2411-wnl changing 1 files +1 −1
  1. maflcko commented at 8:48 pm on November 6, 2024: member

    I don’t think the fuzz target has ever found a real issue. The closest being #25869

    It is also, by far, the slowest fuzz target. For example, looking at https://cirrus-ci.com/task/5533338067271680?logs=ci#L3974, it takes more than one hour:

     0Run wallet_notifications with args ['/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz', '-runs=1', PosixPath('/ci_container_base/ci/scratch/qa-assets/fuzz_corpora/wallet_notifications')]INFO: Running with entropic power schedule (0xFF, 100).
     1INFO: Seed: 1096115652
     2INFO: Loaded 1 modules   (625824 inline 8-bit counters): 625824 [0x5628396d9138, 0x562839771dd8), 
     3INFO: Loaded 1 PC tables (625824 PCs): 625824 [0x562839771dd8,0x56283a0fe7d8), 
     4INFO:     1287 files found in /ci_container_base/ci/scratch/qa-assets/fuzz_corpora/wallet_notifications
     5INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 1047827 bytes
     6INFO: seed corpus: files: 1287 min: 1b max: 1047827b total: 11616898b rss: 172Mb
     7[#16](/bitcoin-bitcoin/16/)	pulse  cov: 14328 ft: 25341 corp: 14/239b exec/s: 5 rss: 204Mb
     8[#64](/bitcoin-bitcoin/64/)	pulse  cov: 19179 ft: 58412 corp: 61/3587b exec/s: 5 rss: 320Mb
     9[#128](/bitcoin-bitcoin/128/)	pulse  cov: 19692 ft: 85738 corp: 125/16Kb exec/s: 3 rss: 544Mb
    10[#256](/bitcoin-bitcoin/256/)	pulse  cov: 19923 ft: 107490 corp: 253/72Kb exec/s: 2 rss: 556Mb
    11[#512](/bitcoin-bitcoin/512/)	pulse  cov: 20107 ft: 124704 corp: 509/330Kb exec/s: 2 rss: 590Mb
    12Slowest unit: 10 s:
    13artifact_prefix='./'; Test unit written to ./slow-unit-9fa5f7d7e4afa1626622ef1b3c70a7563eecf11d
    14[#1024](/bitcoin-bitcoin/1024/)	pulse  cov: 20360 ft: 136324 corp: 1009/2488Kb exec/s: 0 rss: 726Mb
    15Slowest unit: 23 s:
    16artifact_prefix='./'; Test unit written to ./slow-unit-5d99a20de2c2b6bedb0cbaf0ba3743ae3ba13c7c
    17Slowest unit: 26 s:
    18artifact_prefix='./'; Test unit written to ./slow-unit-8889ecb61bdc0650355e0d0d27c012f3239d07a4
    19Slowest unit: 42 s:
    20artifact_prefix='./'; Test unit written to ./slow-unit-d16c084282ac1a85fcdc43c48e49836b08446686
    21[#1289](/bitcoin-bitcoin/1289/)	INITED cov: 20409 ft: 138281 corp: 1245/10323Kb exec/s: 0 rss: 880Mb
    22[#1289](/bitcoin-bitcoin/1289/)	DONE   cov: 20409 ft: 138281 corp: 1245/10323Kb lim: 1047827 exec/s: 0 rss: 880Mb
    23Done 1289 runs in 3813 second(s)
    

    Looking at the flame graphs, it looks like the slow runs spend most of their time in the Knapsack solver. This seems reasonable, because it may run 1000 inner Knapsack iterations 200 times. So reduce the fuzz iterations from 200 to 20 to avoid fuzz timeouts and wasted resources.

  2. fuzz: Limit wallet_notifications iterations fa461d7a43
  3. DrahtBot commented at 8:48 pm on November 6, 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/31238.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK brunoerg, dergoegge

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

  4. DrahtBot added the label Tests on Nov 6, 2024
  5. brunoerg commented at 9:29 pm on November 6, 2024: contributor
    Besides being the slowest, I think this target has poor stability, around 40%. cc: @marcofleon
  6. brunoerg approved
  7. brunoerg commented at 10:10 pm on November 6, 2024: contributor
    code review ACK fa461d7a43aa5a321278c8f734e80fb7aa79bfdb
  8. dergoegge approved
  9. dergoegge commented at 10:21 am on November 7, 2024: member
    lgtm ACK fa461d7a43aa5a321278c8f734e80fb7aa79bfdb
  10. fanquake merged this on Nov 7, 2024
  11. fanquake closed this on Nov 7, 2024

  12. maflcko deleted the branch on Nov 7, 2024

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

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