-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Triaging runtime crash via LLM #253
base: crash-triaging
Are you sure you want to change the base?
Conversation
Experiment based on the idea from google#221 and more.
BTW could you please also resolve the conflict if you have time? |
Some experiment trials failed due to [the failure to initialize the vertex AI model with the given location](https://pantheon.corp.google.com/logs/query;cursorTimestamp=2024-05-20T21:40:30.302955392Z;query=resource.type%3D%22k8s_container%22%0Aresource.labels.project_id%3D%22oss-fuzz%22%0Aresource.labels.location%3D%22us-central1%22%0Aresource.labels.cluster_name%3D%22llm-experiment-large%22%0Aresource.labels.namespace_name%3D%22default%22%0Alabels.k8s-pod%2Fbatch_kubernetes_io%2Fcontroller-uid%3D%226b65ab48-fbd1-4f95-968e-8acf8c36f40c%22%20severity%3E%3DWARNING%0A%0A%0A%0A-textPayload%3D~%22Cannot%20find%20cloud%20run%20log%22%0A-textPayload%3D~%22Multiple%20substring%20matches%22%0A-textPayload%3D~%22Failed%20to%20parse%20error%20message%22%0A-textPayload%3D~%22Unexpected%20empty%20error%20message%22%0A-textPayload%3D~%22could%20not%20find%20specified%20function%22%0A-textPayload%3D~%22introspector.oss-fuzz.com%22%0A-textPayload%3D~%22report.web%22%0A-textPayload%3D~%22Failed%20to%20get%20signature%20from%20FI:%22%0Atimestamp%3D%222024-05-20T21:40:30.302955392Z%22%0AinsertId%3D%22ffxxinjqhavhbaof%22;startTime=2024-05-14T23:38:10.871Z?project=oss-fuzz), which is because of outdated `aiplatform` package.
Collect code coverage for each of the successfully generated integrations. --------- Signed-off-by: David Korczynski <david@adalogics.com>
Signed-off-by: David Korczynski <david@adalogics.com>
…le#297) Signed-off-by: David Korczynski <david@adalogics.com>
- Adjusts the autogen.sh build to be more general (no need to have Makefile as this can be generated by the autogen.sh in some cases). - Uses a unified place for templating - Minor adjustment in directory name of shared folder "autogen-results-X" is now always just "autogen-results" --------- Signed-off-by: David Korczynski <david@adalogics.com>
Hi, I have modified and merged the code. There are two main changes. One is to add a triage column to benchmark.html: The other is to add return statement at the final part of "if crash" condition: Please tell me if further changes are needed. Thank you. |
Triaging runtime crash via LLM mentioned in #221
To reduce the workload of manually triaging runtime crash, we leverage LLM to identify the cause of crash. We pass fuzz target code and crash information to LLM, ask LLM with designed prompts,and save the reponse from LLM. The crash information contains stack trace and sanitizer output. We can also pass related project code to LLM in the future.
Conditions to LLM triaging
Currently, triaging runtime crash with LLM would be activated only when all the following conditions are met:
Input to LLM triaging
To retrieve crash information from fuzz log, we add function
extract_crash_info
to classSemanticCheckResult
inexperiment/fuzz_target_error.py
file. The retrieved information is stored in variablecrash_info
in classRunResult
. The fuzz target code can be obtained fromresult/output-ProjectName-FunctionName/fixed_targets
folder.Prompt design
We require that the LLM: 1) definitively ascertain whether the crash is due to errors within the fuzz target or results from a vulnerability in the project under test; 2) deliver a thorough analysis of the findings. Two triage prompts,
triage_priming.txt
andtriage_problem.txt
, are appended toprompts/template_xml
folder. Three functions,build_triage_prompt
,_format_triage_priming
, and_format_triage_problem
, are added tollm_toolkit/prompt_builder.py
file. The generated triage prompt would be saved inresult/output-ProjectName-FunctionName/fixed_targets/TargetName-triage
folder.Below is a generated prompt example:
LLM triaging
One function,
triage_crash
, is added toexperiment/evaluator.py
file. The core component of LLM triage,crash_triage.py
, is appended tollm_toolkit
folder.crash_triage.py
mainly contains functionsllm_triage
andapply_llm_triage
.Response from LLM triaging
One function,
parse_triage_response
, is appended tollm_toolkit/output_parser.py
file. The generated triage response from LLM would be saved inresult/output-ProjectName-FunctionName/fixed_targets/TargetName-triage
folder.Below is a reponse example:
Additions within
results
folderresult/output-ProjectName-FunctionName/fixed_targets/TargetName-triage
folder is created to store the generated prompt file and trirage rawoutput from LLM.Additions within results report
Triage report is appended to results report web. We add a column
Triage
underRun logs
to store triage reports. One function,get_triage
, is added toreport/web.py
file.