fuzz: Fix RPC internal bug detection #23707

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2112-fuzzBugRpc changing 2 files +6 −4
  1. MarcoFalke commented at 1:28 PM on December 8, 2021: member

    Previously the fuzz test considered any exception which contains the string Internal bug detected (magic string) as a bug. This is not true when the user (fuzzer) passes in the magic string from outside.

    Fix that by:

    1. Changing the format the string in NonFatalCheckError to start with the magic string.
    2. Only treat exceptions that start with the magic string as internal bugs.

    This should fix the bug because any other exception shouldn't start with the magic string.

    To test:

    echo 'bG9nZ2luZ1y+bUludGVybmFsIGJ1ZyBkZXRlY3RlZAAXCqNcjqNcjuYjeg==' | base64 --decode > /tmp/a
    FUZZ=rpc ./src/test/fuzz/fuzz /tmp/a
    

    Before:

    fuzz: test/fuzz/rpc.cpp:365: void rpc_fuzz_target(FuzzBufferType): Assertion `error_msg.find("trigger_internal_bug") != std::string::npos' failed.
    

    After:

    Executed /tmp/a in 0 ms
    
  2. fuzz: Fix RPC internal bug detection fa77f95c2f
  3. MarcoFalke added the label Tests on Dec 8, 2021
  4. shaavan approved
  5. shaavan commented at 2:59 PM on December 8, 2021: contributor

    crACK fa77f95c2ff4ae7761208d06bcbeb59650612367

  6. MarcoFalke merged this on Dec 8, 2021
  7. MarcoFalke closed this on Dec 8, 2021

  8. MarcoFalke deleted the branch on Dec 8, 2021
  9. sidhujag referenced this in commit e116c889ff on Dec 8, 2021
  10. RandyMcMillan referenced this in commit 5ea67c252c on Dec 23, 2021
  11. DrahtBot locked this on Dec 8, 2022
Contributors
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-17 06:14 UTC

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