mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-12 11:19:08 -05:00
test: Work around libFuzzer deadlock
This commit is contained in:
parent
80486e7e2d
commit
fa39c8a3e8
1 changed files with 17 additions and 10 deletions
|
@ -14,6 +14,14 @@ import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def get_fuzz_env(*, target):
|
||||||
|
return {
|
||||||
|
'FUZZ': target,
|
||||||
|
'ASAN_OPTIONS': # symbolizer disabled due to https://github.com/google/sanitizers/issues/1364#issuecomment-761072085
|
||||||
|
'symbolize=0:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
||||||
|
@ -129,9 +137,7 @@ def main():
|
||||||
os.path.join(config["environment"]["BUILDDIR"], 'src', 'test', 'fuzz', 'fuzz'),
|
os.path.join(config["environment"]["BUILDDIR"], 'src', 'test', 'fuzz', 'fuzz'),
|
||||||
'-help=1',
|
'-help=1',
|
||||||
],
|
],
|
||||||
env={
|
env=get_fuzz_env(target=test_list_selection[0]),
|
||||||
'FUZZ': test_list_selection[0]
|
|
||||||
},
|
|
||||||
timeout=20,
|
timeout=20,
|
||||||
check=True,
|
check=True,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
|
@ -186,9 +192,7 @@ def generate_corpus_seeds(*, fuzz_pool, build_dir, seed_dir, targets):
|
||||||
' '.join(command),
|
' '.join(command),
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
command,
|
command,
|
||||||
env={
|
env=get_fuzz_env(target=t),
|
||||||
'FUZZ': t
|
|
||||||
},
|
|
||||||
check=True,
|
check=True,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
universal_newlines=True,
|
universal_newlines=True,
|
||||||
|
@ -227,9 +231,7 @@ def merge_inputs(*, fuzz_pool, corpus, test_list, build_dir, merge_dir):
|
||||||
output = 'Run {} with args {}\n'.format(t, " ".join(args))
|
output = 'Run {} with args {}\n'.format(t, " ".join(args))
|
||||||
output += subprocess.run(
|
output += subprocess.run(
|
||||||
args,
|
args,
|
||||||
env={
|
env=get_fuzz_env(target=t),
|
||||||
'FUZZ': t
|
|
||||||
},
|
|
||||||
check=True,
|
check=True,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
universal_newlines=True,
|
universal_newlines=True,
|
||||||
|
@ -257,7 +259,12 @@ def run_once(*, fuzz_pool, corpus, test_list, build_dir, use_valgrind):
|
||||||
|
|
||||||
def job(t, args):
|
def job(t, args):
|
||||||
output = 'Run {} with args {}'.format(t, args)
|
output = 'Run {} with args {}'.format(t, args)
|
||||||
result = subprocess.run(args, env={'FUZZ': t}, stderr=subprocess.PIPE, universal_newlines=True)
|
result = subprocess.run(
|
||||||
|
args,
|
||||||
|
env=get_fuzz_env(target=t),
|
||||||
|
stderr=subprocess.PIPE,
|
||||||
|
universal_newlines=True,
|
||||||
|
)
|
||||||
output += result.stderr
|
output += result.stderr
|
||||||
return output, result
|
return output, result
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue