mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
fuzz: Generate with random libFuzzer settings
This commit is contained in:
parent
9eeee7caa3
commit
fa4e396e1d
1 changed files with 5 additions and 1 deletions
|
@ -11,6 +11,7 @@ import argparse
|
||||||
import configparser
|
import configparser
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import random
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -264,9 +265,12 @@ def generate_corpus(*, fuzz_pool, src_dir, build_dir, corpus_dir, targets):
|
||||||
for target, t_env in targets:
|
for target, t_env in targets:
|
||||||
target_corpus_dir = corpus_dir / target
|
target_corpus_dir = corpus_dir / target
|
||||||
os.makedirs(target_corpus_dir, exist_ok=True)
|
os.makedirs(target_corpus_dir, exist_ok=True)
|
||||||
|
use_value_profile = int(random.random() < .3)
|
||||||
command = [
|
command = [
|
||||||
os.path.join(build_dir, 'src', 'test', 'fuzz', 'fuzz'),
|
os.path.join(build_dir, 'src', 'test', 'fuzz', 'fuzz'),
|
||||||
"-runs=100000",
|
"-max_total_time=6000",
|
||||||
|
"-reload=0",
|
||||||
|
f"-use_value_profile={use_value_profile}",
|
||||||
target_corpus_dir,
|
target_corpus_dir,
|
||||||
]
|
]
|
||||||
futures.append(fuzz_pool.submit(job, command, target, t_env))
|
futures.append(fuzz_pool.submit(job, command, target, t_env))
|
||||||
|
|
Loading…
Add table
Reference in a new issue