File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
infra/base-images/base-runner Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,14 @@ function run_fuzz_target {
99
99
100
100
export LLVM_PROFILE_FILE=$profraw_file
101
101
timeout $TIMEOUT $OUT /$target $args & > $LOGS_DIR /$target .log
102
- if (( $? != 0 )) ; then
102
+ cov_retcode=$?
103
+
104
+ target_error_log=" $LOGS_DIR /${target} _error.log"
105
+ grep -E " ==[0-9]+== ERROR: libFuzzer:" " $LOGS_DIR /$target .log" > " $target_error_log "
106
+ grep_retcode=$?
107
+
108
+ echo " Cov returncode: $cov_retcode , grep returncode: $grep_retcode "
109
+ if (( $cov_retcode != 0 || $grep_retcode == 0 )) ; then
103
110
echo " Error occured while running $target :"
104
111
cat $LOGS_DIR /$target .log
105
112
fi
@@ -126,6 +133,12 @@ function run_fuzz_target {
126
133
llvm-cov export -summary-only -instr-profile=$profdata_file -object=$target \
127
134
$shared_libraries $LLVM_COV_COMMON_ARGS > $FUZZER_STATS_DIR /$target .json
128
135
136
+ # If grep returned zero an error was matched.
137
+ echo " Coverage error, creating log file: $FUZZER_STATS_DIR /${target} _error.log"
138
+ if (( $cov_retcode != 0 || $grep_retcode == 0 )) ; then
139
+ mv " $target_error_log " " $FUZZER_STATS_DIR /${target} _error.log" ;
140
+ fi
141
+
129
142
# For introspector.
130
143
llvm-cov show -instr-profile=$profdata_file -object=$target -line-coverage-gt=0 $shared_libraries $BRANCH_COV_ARGS $LLVM_COV_COMMON_ARGS > ${TEXTCOV_REPORT_DIR} /$target .covreport
131
144
}
You can’t perform that action at this time.
0 commit comments