Replay crashing inputs

This commit is contained in:
Matthew Knight 2026-03-06 09:44:48 -08:00
parent 40c1552021
commit d2b8ff9ce3
No known key found for this signature in database
1 changed files with 17 additions and 1 deletions

View File

@ -249,12 +249,28 @@ runs:
;; ;;
esac 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}" echo "Uploading crash: ${CRASH_NAME}"
set -- -server "${CAIRN_SERVER}" -repo "${REPO}" -owner "${OWNER}" \ set -- -server "${CAIRN_SERVER}" -repo "${REPO}" -owner "${OWNER}" \
-commit "${COMMIT}" -run-id "${RUN_ID}" -type fuzz -file "${crash_file}" \ -commit "${COMMIT}" -run-id "${RUN_ID}" -type fuzz -file "${crash_file}" \
-kind crash \ -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 if [ -n "${TARGET_PLATFORM}" ]; then
set -- "$@" -target "${TARGET_PLATFORM}" set -- "$@" -target "${TARGET_PLATFORM}"
fi fi