-
Notifications
You must be signed in to change notification settings - Fork 169
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
@Ekam219: Fix Logging and Error Handling for get_benchmark_final_target_code #919
base: main
Are you sure you want to change the base?
Conversation
/gcbrun exp -n ej -ag |
Sibling PR: #918 |
There is something wrong with the report (no crash, no fuzz target source code) but I reckon it's from another PR. |
) ## Description This PR addresses the issue of missing source code by adding enhanced logging and improving error handling in the `get_benchmark_final_target_code()` method. Previously, silent failures could occur, making it difficult to diagnose the root cause of missing source code. ## Changes - **Enhanced Logging**: Logs are added to track when the `sample_id` is invalid or the source code is missing. - **Error Handling**: Ensures that malformed or empty `sample_id` values are handled gracefully and logged appropriately. - **Return Null for Missing Source Code**: In case of an error, the function explicitly returns `None` rather than an empty string for clarity in JSON outputs. #908 It may also refer to #625 ## Benefits - Improved **debuggability** by making it easier to identify the reasons behind missing source code. - Increased **robustness** by preventing silent failures and ensuring more informative logs and error handling.
/gcbrun exp -n ej -ag |
Hi @Ekam219 {
"benchmark": "int LibRaw::crxDecodePlane(void *, uint32_t)",
"sample": "08",
"status": "Done",
"compiles": "True",
"crashes": "True",
"crash_reason": "NO_SEMANTIC_ERR",
"bug": "True",
"triage": "",
"coverage": "4.34",
"coverage_diff": "0.00014912908613696016",
"coverage_report": "#",
"stacktrace": "/stacktrace",
"target_binary": "/target_binary",
"reproducer": "/artifacts",
"run_log": "run.log",
"source_code": null,
"model": "vertex_ai_gemini-1-5-chat"
}, |
Sure , looking into this |
@@ -284,7 +310,7 @@ def get_final_target_code(self, benchmark: str, sample: str) -> str: | |||
targets_dir = os.path.join(self._results_dir, benchmark, 'fixed_targets') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reckon this could be the cause.
Previously OSS-Fuzz-Gen saves the final fuzz target in to this dir.
Now it is placed into:
results/output-libraw-_zn6libraw14crxdecodeplaneepvj/fuzz_targets/{sample_id}.fuzz_target
results/output-libraw-_zn6libraw14crxdecodeplaneepvj/fuzz_targets/{sample_id}.build_script
From @Ekam219's #910.