diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-12-08 16:50:21 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-12-08 16:50:28 +0100 |
commit | 926fc2a0d4ff64cf2ff8e1dfa64eca2ebd24e090 (patch) | |
tree | 3246ff56ec34c154cb49f5aaea19d3f7710b7158 /test/functional/p2p_addr_relay.py | |
parent | 577bd51a4b8de066466a445192c1c653872657e2 (diff) | |
parent | fa77f95c2ff4ae7761208d06bcbeb59650612367 (diff) |
Merge bitcoin/bitcoin#23707: fuzz: Fix RPC internal bug detection
fa77f95c2ff4ae7761208d06bcbeb59650612367 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 fa77f95c2ff4ae7761208d06bcbeb59650612367
Tree-SHA512: 079bc97b6ce0cbad8603c7b577cc1ac0fd19e884ccbaba317588b91d98b36afeaa8cb398344b52bf12c9fd1737b3fdd8452b4e833a3b06cb3c789651955f78b8
Diffstat (limited to 'test/functional/p2p_addr_relay.py')
0 files changed, 0 insertions, 0 deletions