Merge pull request 'Replay crashing inputs' (#15) from crash-report into main
Reviewed-on: https://git.ts.mattnite.net/mattnite/cairn/pulls/15
This commit is contained in:
commit
944296c146
|
|
@ -249,12 +249,28 @@ runs:
|
|||
;;
|
||||
esac
|
||||
|
||||
# Replay the crash input to capture the stack trace.
|
||||
STACK_TRACE=""
|
||||
CRASH_MSG="AFL++ crash (${FUZZ_TARGET}): ${CRASH_NAME}"
|
||||
REPLAY_OUTPUT=$(timeout 10 "${FUZZ_BIN}" < "${crash_file}" 2>&1 || true)
|
||||
if [ -n "${REPLAY_OUTPUT}" ]; then
|
||||
STACK_TRACE="${REPLAY_OUTPUT}"
|
||||
# Extract a concise crash message from the first meaningful line.
|
||||
FIRST_LINE=$(echo "${REPLAY_OUTPUT}" | grep -m1 -iE 'panic|error|fault|abort|overflow|undefined|sanitizer|SUMMARY' || true)
|
||||
if [ -n "${FIRST_LINE}" ]; then
|
||||
CRASH_MSG="${FIRST_LINE}"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Uploading crash: ${CRASH_NAME}"
|
||||
set -- -server "${CAIRN_SERVER}" -repo "${REPO}" -owner "${OWNER}" \
|
||||
-commit "${COMMIT}" -run-id "${RUN_ID}" -type fuzz -file "${crash_file}" \
|
||||
-kind crash \
|
||||
-crash-message "AFL++ crash (${FUZZ_TARGET}): ${CRASH_NAME}"
|
||||
-crash-message "${CRASH_MSG}"
|
||||
|
||||
if [ -n "${STACK_TRACE}" ]; then
|
||||
set -- "$@" -stack-trace "${STACK_TRACE}"
|
||||
fi
|
||||
if [ -n "${TARGET_PLATFORM}" ]; then
|
||||
set -- "$@" -target "${TARGET_PLATFORM}"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in New Issue