Skip to content

Gracefully handle invalid ghost fuzzer configurations#5380

Merged
dylanjew merged 2 commits into
masterfrom
dylanj/invalid-fuzzer
Jul 23, 2026
Merged

Gracefully handle invalid ghost fuzzer configurations#5380
dylanjew merged 2 commits into
masterfrom
dylanj/invalid-fuzzer

Conversation

@dylanjew

@dylanjew dylanjew commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

When a job's fuzzer gets detached, it leaves a FuzzerJob mapping with an empty string for the fuzzer.

I'm not sure whether there were new tasks being scheduled or it was the existing ones blocking up the queue, but this PR focuses on clearing out the queue.

When the workers picked up these ghost tasks, setup.py would fetch an invalid Fuzzer entity that lacked a blobstore_key and pass it to blobs.py in get_gcs_path, which triggered a TypeError.

This change raises an InvalidFuzzerError up front instead, gracefully clearing the bad tasks without crashing.

This doesn't fix the issue where we're scheduling invalid fuzz tasks, but it should clear the queue by ACKing these bad tasks.

@dylanjew
dylanjew requested a review from a team as a code owner July 23, 2026 16:07
@dylanjew
dylanjew force-pushed the dylanj/invalid-fuzzer branch from 4f809a1 to cf5f022 Compare July 23, 2026 16:17

errors = result.get('insertErrors', [])
failed_count = len(errors)
insert_errors = result.get('insertErrors', [])

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

name conflict with the package

dylanjew added 2 commits July 23, 2026 12:31
When a job's fuzzer gets detached, it leaves a FuzzerJob mapping with an empty
string for the fuzzer. These empty fuzzers were getting scheduled due to their
weight remaining positive. When the workers picked up these ghost tasks, setup.py
would fetch an invalid Fuzzer entity that lacked a blobstore_key and pass it to
blobs.py in get_gcs_path, which triggered a TypeError.

This change raises an InvalidFuzzerError up front instead, gracefully clearing
the bad tasks without crashing.
@dylanjew
dylanjew force-pushed the dylanj/invalid-fuzzer branch from cf5f022 to f4b7c15 Compare July 23, 2026 16:31
@dylanjew

Copy link
Copy Markdown
Collaborator Author

@vitaliset Fixed the test

@dylanjew
dylanjew merged commit ba2f3c8 into master Jul 23, 2026
14 of 15 checks passed
@dylanjew
dylanjew deleted the dylanj/invalid-fuzzer branch July 23, 2026 16:36
dylanjew added a commit that referenced this pull request Jul 23, 2026
dylanjew added a commit that referenced this pull request Jul 23, 2026
dylanjew added a commit that referenced this pull request Jul 23, 2026
dylanjew added a commit that referenced this pull request Jul 23, 2026
#5380 fixed the issue where
our queue was getting flooded with bad tasks but broke libfuzzer because
engine fuzzers do not need a `blobstore_key`. Instead it skips the
function that was causing an error for the misconfigured fuzzers

I queried the Datastore and confirmed that when builtin=True, the
blobstore_key is null for the engine fuzzers: `syzkaller,
googlefuzztest, centipede, libfuzzer`. Additionally, the invalid fuzzer
with `"Name/ID": "name=ochang_js_fuzzer_test"` is also there, which was
what caused the initial errors

This fixed the invalid FuzzerJob handling, but caused an issue with
other libfuzzer fuzzers because libfuzzer has no blobstore key, but
skips this look up that would fail because it has not blobstore key
since `builtin = False`

https://github.com/google/clusterfuzz/blob/05360c5aa9db354f6a9d83a105583eae7a230551/src/clusterfuzz/_internal/bot/tasks/setup.py#L606-L608
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.

2 participants