Skip to content

Commit 29e7841

Browse files
authored
output failed fuzz cases (simdjson#409)
this is to get more debug output from cases like this: https://github.com/lemire/simdjson/commit/c9cd8e62111a7b25c240bea08a175de5ec6f8def/checks?check_suite_id=351526761 https://pipelines.actions.githubusercontent.com/gFSIASDqcDhMdHkcuMJEdsUcdOsOrVBr8d56BjAkszcoMkibGp/_apis/pipelines/1/runs/274/signedlogcontent/3?urlExpires=2019-12-21T18%3A50%3A08.3387613Z&urlSigningMethod=HMACV1&urlSignature=DVF3u4jEs81xJP6Hmi8LLQlLOztJke8MsP62J0MXruQ%3D which ends with: 2019-12-20T23:08:42.6830393Z ../src/generic/numberparsing.h:243:31: runtime error: 1e+311 is outside the range of representable values of type 'double' 2019-12-20T23:08:42.6836790Z SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/generic/numberparsing.h:243:31 in 2019-12-20T23:08:42.6837715Z MS: 2 InsertRepeatedBytes-CrossOver-; base unit: 47cf79b80bc84f2ec8b39c1c73daa6c1222ef624 2019-12-20T23:08:42.6866416Z artifact_prefix='./'; Test unit written to ./crash-3fa2f47d980d4bf5812af18fb0d0a0ce9b5cc65a 2019-12-20T23:08:42.6999448Z ##[error]Process completed with exit code 1. 2019-12-20T23:08:42.7030863Z Cleaning up orphan processes The problem is that github actions does not store artifacts on failure.
1 parent 8192e63 commit 29e7841

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

.github/workflows/fuzzers.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
env:
1717
allfuzzers: parser dump
18+
artifactsprefix: -artifact_prefix=fuzzfailure/
1819
steps:
1920
- name: Install packages necessary for building
2021
run: |
@@ -44,7 +45,7 @@ jobs:
4445
- name: Verify that the oss-fuzz seed corpus passes without problems
4546
run: |
4647
mkdir seedcorpus
47-
unzip -d seedcorpus seed_corpus.zip
48+
unzip -q -d seedcorpus seed_corpus.zip
4849
for buildvariant in noavx withavx; do
4950
for fuzzer in $allfuzzers; do
5051
build-ossfuzz-$buildvariant/fuzz/fuzz_$fuzzer seedcorpus -max_total_time=1
@@ -54,17 +55,27 @@ jobs:
5455
run: |
5556
for fuzzer in $allfuzzers; do
5657
mkdir -p out/$fuzzer # in case this is a new fuzzer, or corpus.tar is broken
57-
build-ossfuzz-fast8/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=30
58+
build-ossfuzz-fast8/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=30 $artifactsprefix || touch failed
59+
# make sure the failing output is visible in the log
60+
if [ -e failed ] ; then
61+
ls fuzzfailure/* |xargs -n1 base64
62+
exit 1
63+
fi
5864
done
5965
- name: Run the other fuzzer variants for $fuzzer, with sanitizers etc
6066
run: |
6167
for fuzzer in $allfuzzers; do
62-
build-ossfuzz-withavx/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=20
63-
build-ossfuzz-noavx/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10
64-
build-ossfuzz-noavx8/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10
68+
build-ossfuzz-withavx/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=20 $artifactsprefix || touch failed
69+
build-ossfuzz-noavx/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10 $artifactsprefix || touch failed
70+
build-ossfuzz-noavx8/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10 $artifactsprefix || touch failed
71+
if [ -e failed ] ; then
72+
# make sure the failing output is visible in the log
73+
ls fuzzfailure/* |xargs -n1 base64
74+
exit 1
75+
fi
6576
echo disable msan runs, it fails inside the fuzzing engine and not the fuzzed code!
66-
echo build-ossfuzz-msan-noavx8/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10 -reload=0
67-
echo build-ossfuzz-msan-withavx8/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10 -reload=0
77+
echo build-ossfuzz-msan-noavx8/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10 -reload=0 $artifactsprefix
78+
echo build-ossfuzz-msan-withavx8/fuzz/fuzz_$fuzzer out/$fuzzer -max_total_time=10 -reload=0 $artifactsprefix
6879
echo now have $(ls out/$fuzzer |wc -l) files in corpus
6980
done
7081
- name: Minimize the corpus with the fast fuzzer

0 commit comments

Comments
 (0)