Skip to content

Commit ce75fc3

Browse files
author
MarcoFalke
committed
Merge #20971: test: Work around libFuzzer deadlock
fa39c8a test: Work around libFuzzer deadlock (MarcoFalke) Pull request description: Only required part is `symbolize=0`, but the other changes shouldn't hurt ACKs for top commit: practicalswift: cr ACK fa39c8a: patch looks correct Tree-SHA512: 9cddf1de46ad12aea9b8be2c1acb86ba0e07ffdb52f8155d943edf970955551c7cb049a3a6c027846b45dab0dc0966dec42999476ebde50aa761a08dbb751eae
2 parents cbe4396 + fa39c8a commit ce75fc3

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

test/fuzz/test_runner.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
import sys
1515

1616

17+
def get_fuzz_env(*, target):
18+
return {
19+
'FUZZ': target,
20+
'ASAN_OPTIONS': # symbolizer disabled due to https://github.com/google/sanitizers/issues/1364#issuecomment-761072085
21+
'symbolize=0:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1',
22+
}
23+
24+
1725
def main():
1826
parser = argparse.ArgumentParser(
1927
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
@@ -129,9 +137,7 @@ def main():
129137
os.path.join(config["environment"]["BUILDDIR"], 'src', 'test', 'fuzz', 'fuzz'),
130138
'-help=1',
131139
],
132-
env={
133-
'FUZZ': test_list_selection[0]
134-
},
140+
env=get_fuzz_env(target=test_list_selection[0]),
135141
timeout=20,
136142
check=True,
137143
stderr=subprocess.PIPE,
@@ -186,9 +192,7 @@ def job(command, t):
186192
' '.join(command),
187193
subprocess.run(
188194
command,
189-
env={
190-
'FUZZ': t
191-
},
195+
env=get_fuzz_env(target=t),
192196
check=True,
193197
stderr=subprocess.PIPE,
194198
universal_newlines=True,
@@ -227,9 +231,7 @@ def job(t, args):
227231
output = 'Run {} with args {}\n'.format(t, " ".join(args))
228232
output += subprocess.run(
229233
args,
230-
env={
231-
'FUZZ': t
232-
},
234+
env=get_fuzz_env(target=t),
233235
check=True,
234236
stderr=subprocess.PIPE,
235237
universal_newlines=True,
@@ -257,7 +259,12 @@ def run_once(*, fuzz_pool, corpus, test_list, build_dir, use_valgrind):
257259

258260
def job(t, args):
259261
output = 'Run {} with args {}'.format(t, args)
260-
result = subprocess.run(args, env={'FUZZ': t}, stderr=subprocess.PIPE, universal_newlines=True)
262+
result = subprocess.run(
263+
args,
264+
env=get_fuzz_env(target=t),
265+
stderr=subprocess.PIPE,
266+
universal_newlines=True,
267+
)
261268
output += result.stderr
262269
return output, result
263270

0 commit comments

Comments
 (0)