Skip to content

Commit ee7e4b0

Browse files
committed
Merge bitcoin/bitcoin#28178: fuzz: Generate with random libFuzzer settings
fa3a410 fuzz: Set -rss_limit_mb=8000 for generate as well (MarcoFalke) fa4e396 fuzz: Generate with random libFuzzer settings (MarcoFalke) Pull request description: Sometimes a libFuzzer setting like `-use_value_profile=1` helps [0], sometimes it hurts [1]. [0] bitcoin/bitcoin#20789 (comment) [1] bitcoin/bitcoin#27888 (comment) By picking a random value, it is ensured that at least some of the runs will have the beneficial configuration set. Also, set `-max_total_time` to prevent slow fuzz targets from getting a larger time share, or possibly peg to a single core for a long time and block the python script from exiting for a long time. This can be improved in the future. For example, the python script can exit after some time (bitcoin/bitcoin#20752 (comment)). Alternatively, it can measure if coverage progress was made and run for less time if no progress has been made recently anyway, so that more time can be spent on targets that are new or still make progress. ACKs for top commit: murchandamus: utACK fa3a410 dergoegge: utACK fa3a410 brunoerg: light ACK fa3a410 Tree-SHA512: bfd04a76ca09aec612397bae5f3f263a608faa7087697169bd4c506c8195c4d2dd84ddc7fcd3ebbc75771eab618fad840af819114968ca3668fc730092376768
2 parents 4d7d7fd + fa3a410 commit ee7e4b0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/fuzz/test_runner.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import configparser
1212
import logging
1313
import os
14+
import random
1415
import subprocess
1516
import sys
1617

@@ -264,9 +265,13 @@ def job(command, t, t_env):
264265
for target, t_env in targets:
265266
target_corpus_dir = corpus_dir / target
266267
os.makedirs(target_corpus_dir, exist_ok=True)
268+
use_value_profile = int(random.random() < .3)
267269
command = [
268270
os.path.join(build_dir, 'src', 'test', 'fuzz', 'fuzz'),
269-
"-runs=100000",
271+
"-rss_limit_mb=8000",
272+
"-max_total_time=6000",
273+
"-reload=0",
274+
f"-use_value_profile={use_value_profile}",
270275
target_corpus_dir,
271276
]
272277
futures.append(fuzz_pool.submit(job, command, target, t_env))

0 commit comments

Comments
 (0)