Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Logging] Add logs context to Fuzz Task #4777

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

Merged
merged 2 commits into from
May 2, 2025

Conversation

ViniciustCosta
Copy link
Collaborator

@ViniciustCosta ViniciustCosta commented Apr 30, 2025

Description

This PR adds structured logging to the fuzz task by instrumenting it with the fuzzing-related logs context.
Notes that for preprocess, the fuzz target is set to None until it is is picked.

Tests

Onebox deployment to internal (chrome) GCE instance (link to logs):

  • Stage - Preprocess:
    image

  • Stage - Main:
    image

Copy link
Collaborator

@vitorguidi vitorguidi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -2060,6 +2068,8 @@ def utask_preprocess(fuzzer_name, job_type, uworker_env):
fuzz_target = _preprocess_get_fuzz_target(fuzzer_name, job_type)
fuzz_task_input = uworker_msg_pb2.FuzzTaskInput() # pylint: disable=no-member
if fuzz_target:
# Add the chosen fuzz target to logs context.
logs.log_contexts.add_metadata('fuzz_target', fuzz_target.binary)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do the tear down for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already handled by the fuzzer log context that is wrapping the function call (here). So this is essentially updating this metadata, not adding it.

@ViniciustCosta ViniciustCosta merged commit 6049c4f into master May 2, 2025
7 checks passed
@ViniciustCosta ViniciustCosta deleted the feat/add_structured_logs_fuzz_task branch May 2, 2025 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants