Optimize GDB prompt in CrashAnalyzer #1141
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pr is used to optimize the gdb prompt. The language is more refined and unified, and the structure is clearer.
In particular, In GDB, do not use shell-style redirection like:
run < {AFTIFACT_PATH}
This won't work because GDB is not a shell. I have seen too many these cases, LLM model like GPT-4o also makes this mistake.
Also, avoid using:
run -- {AFTIFACT_PATH}
unless the fuzz driver explicitly expects that pattern. Relevant case: https://llm-exp.oss-fuzz.com/Result-reports/ofg-pr/2025-07-01-1133-pamusuo-comparison/sample/output-igraph-igraph_sparsemat_arpack_rssolve/03.html#:~:text=54%3A58%20%5BTrial%20ID%3A%2003%5D%20INFO%20%5Bbase_agent.-,chat_llm,-%3A96%5D%3A
Furthermore, while
run {AFTIFACT_PATH}
seems correct, it may execute the testcase multiple times, depending on how libFuzzer is configured.✅ Instead, always use:
run -runs=1 {AFTIFACT_PATH}
to ensure the fuzz driver runs exactly once with the provided testcase — ideal for reproducible crash debugging.