Repository navigation
fuzz: Fix RPC internal bug detection - #23707
Merged
Merged
Conversation
shaavan
approved these changes
Dec 8, 2021
RandyMcMillan
pushed a commit
to RandyMcMillan/mempool-tab
that referenced
this pull request
Dec 23, 2021
ca75ffd fuzz: Fix RPC internal bug detection (MarcoFalke) Pull request description: 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 ACKs for top commit: shaavan: crACK ca75ffd Tree-SHA512: 079bc97b6ce0cbad8603c7b577cc1ac0fd19e884ccbaba317588b91d98b36afeaa8cb398344b52bf12c9fd1737b3fdd8452b4e833a3b06cb3c789651955f78b8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
NonFatalCheckErrorto start with the magic string.This should fix the bug because any other exception shouldn't start with the magic string.
To test:
Before:
After: