Skip to content

Commit ab317ad

Browse files
committed
Merge bitcoin/bitcoin#30804: fuzz: Rename fuzz_seed_corpus to fuzz_corpora
8888bee scripted-diff: fuzz: Rename fuzz_seed_corpus to fuzz_corpora (MarcoFalke) Pull request description: Now that cmake was a breaking change for all fuzz scripts, it seems fine to bundle it with another breaking change to rename the fuzz corpora directory, as discussed and approved in bitcoin-core/qa-assets#200: * The word "seed" in the old name doesn't really apply. In reality it is a collection of fuzz input seeds, as well as fuzz inputs. * The rename will also allow in the future (when there is a need and desire) to provide a minimal set of possibly hand-crafted or otherwise non-fuzz-generated fuzz seed inputs to some fuzz targets (and possibly store them in a separate folder and validate that their format is still accurate and matches the fuzz target code). * Finally, "corpus" is renamed to corpora, to clarify that the folder holds the fuzz inputs for several fuzz targets. ACKs for top commit: brunoerg: ACK 8888bee marcofleon: ACK 8888bee Tree-SHA512: abc693ca5d946850f04b6349e2a98f8fbc2ba9991be5a025bc0f357e341cbe7510f2f5f0e47b997d07136736d818df361270f372b8fb70860995a0605ca81e4d
2 parents 4835bba + 8888bee commit ab317ad

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ jobs:
224224
env:
225225
BITCOINFUZZ: '${{ github.workspace }}\build\src\test\fuzz\Release\fuzz.exe'
226226
shell: cmd
227-
run: py -3 test\fuzz\test_runner.py --par %NUMBER_OF_PROCESSORS% --loglevel DEBUG %RUNNER_TEMP%\qa-assets\fuzz_seed_corpus
227+
run: py -3 test\fuzz\test_runner.py --par %NUMBER_OF_PROCESSORS% --loglevel DEBUG %RUNNER_TEMP%\qa-assets\fuzz_corpora
228228

229229
asan-lsan-ubsan-integer-no-depends-usdt:
230230
name: 'ASan + LSan + UBSan + integer, no depends, USDT'

ci/test/03_test_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ EOF
5454
)
5555

5656
if [ "$RUN_FUZZ_TESTS" = "true" ]; then
57-
export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_seed_corpus/
57+
export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_corpora/
5858
if [ ! -d "$DIR_FUZZ_IN" ]; then
5959
${CI_RETRY_EXE} git clone --depth=1 https://github.com/bitcoin-core/qa-assets "${DIR_QA_ASSETS}"
6060
fi

cmake/script/CoverageFuzz.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
include(${CMAKE_CURRENT_LIST_DIR}/CoverageInclude.cmake)
66

7-
if(NOT DEFINED FUZZ_SEED_CORPUS_DIR)
8-
set(FUZZ_SEED_CORPUS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/qa-assets/fuzz_seed_corpus)
7+
if(NOT DEFINED FUZZ_CORPORA_DIR)
8+
set(FUZZ_CORPORA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/qa-assets/fuzz_corpora)
99
endif()
1010

1111
execute_process(
12-
COMMAND test/fuzz/test_runner.py ${FUZZ_SEED_CORPUS_DIR} --loglevel DEBUG
12+
COMMAND test/fuzz/test_runner.py ${FUZZ_CORPORA_DIR} --loglevel DEBUG
1313
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
1414
COMMAND_ERROR_IS_FATAL ANY
1515
)

doc/fuzzing.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ of the test. Just make sure to use double-dash to distinguish them from the
8080
fuzzer's own arguments:
8181
8282
```sh
83-
$ FUZZ=address_deserialize_v2 build_fuzz/src/test/fuzz/fuzz -runs=1 fuzz_seed_corpus/address_deserialize_v2 --checkaddrman=5 --printtoconsole=1
83+
$ FUZZ=address_deserialize_v2 build_fuzz/src/test/fuzz/fuzz -runs=1 fuzz_corpora/address_deserialize_v2 --checkaddrman=5 --printtoconsole=1
8484
```
8585
8686
## Fuzzing corpora
@@ -91,11 +91,11 @@ To fuzz `process_message` using the [`bitcoin-core/qa-assets`](https://github.co
9191
9292
```sh
9393
$ git clone https://github.com/bitcoin-core/qa-assets
94-
$ FUZZ=process_message build_fuzz/src/test/fuzz/fuzz qa-assets/fuzz_seed_corpus/process_message/
94+
$ FUZZ=process_message build_fuzz/src/test/fuzz/fuzz qa-assets/fuzz_corpora/process_message/
9595
INFO: Seed: 1346407872
9696
INFO: Loaded 1 modules (424174 inline 8-bit counters): 424174 [0x55d8a9004ab8, 0x55d8a906c3a6),
9797
INFO: Loaded 1 PC tables (424174 PCs): 424174 [0x55d8a906c3a8,0x55d8a96e5288),
98-
INFO: 991 files found in qa-assets/fuzz_seed_corpus/process_message/
98+
INFO: 991 files found in qa-assets/fuzz_corpora/process_message/
9999
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
100100
INFO: seed corpus: files: 991 min: 1b max: 1858b total: 288291b rss: 150Mb
101101
#993 INITED cov: 7063 ft: 8236 corp: 25/3821b exec/s: 0 rss: 181Mb
@@ -124,7 +124,7 @@ Patience is useful; even with improved throughput, libFuzzer may need days and
124124
quickly from a crash case)
125125
- run the fuzzer with the case number appended to the seed corpus path:
126126
`FUZZ=process_message build_fuzz/src/test/fuzz/fuzz
127-
qa-assets/fuzz_seed_corpus/process_message/1bc91feec9fc00b107d97dc225a9f2cdaa078eb6`
127+
qa-assets/fuzz_corpora/process_message/1bc91feec9fc00b107d97dc225a9f2cdaa078eb6`
128128
129129
## Submit improved coverage
130130
@@ -340,7 +340,7 @@ Fuzzing with Eclipser will likely be much more effective if using an existing co
340340
341341
```sh
342342
$ git clone https://github.com/bitcoin-core/qa-assets
343-
$ FUZZ=bech32 dotnet Eclipser/build/Eclipser.dll fuzz -p build_fuzz/src/test/fuzz/fuzz -t 36000 -i qa-assets/fuzz_seed_corpus/bech32 outputs --src stdin
343+
$ FUZZ=bech32 dotnet Eclipser/build/Eclipser.dll fuzz -p build_fuzz/src/test/fuzz/fuzz -t 36000 -i qa-assets/fuzz_corpora/bech32 outputs --src stdin
344344
```
345345
346346
Note that fuzzing with Eclipser on certain targets (those that create 'full nodes', e.g. `process_message*`) will,

src/test/fuzz/fuzz.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static std::vector<const char*> g_args;
4949
static void SetArgs(int argc, char** argv) {
5050
for (int i = 1; i < argc; ++i) {
5151
// Only take into account arguments that start with `--`. The others are for the fuzz engine:
52-
// `fuzz -runs=1 fuzz_seed_corpus/address_deserialize_v2 --checkaddrman=5`
52+
// `fuzz -runs=1 fuzz_corpora/address_deserialize_v2 --checkaddrman=5`
5353
if (strlen(argv[i]) > 2 && argv[i][0] == '-' && argv[i][1] == '-') {
5454
g_args.push_back(argv[i]);
5555
}

0 commit comments

Comments
 (0)