replay.py: an empty env value emitted a SyntaxError, breaking every replay script - #258
Merged
Conversation
…eplay script
formatPath() builds its result by appending pieces, then joins them. For an empty value
nothing is ever appended, so it returned "" and the env-dict emitter wrote
"DEBUGINFOD_URLS": ,
which is a SyntaxError. fusil sets DEBUGINFOD_URLS="" in EVERY target child (the
llvm-symbolizer workaround, __init__.py:791), so this is the common case, not an edge
case: measured across the existing runs under /home/fusil/runs, 60 of 60 sampled
replay.py files fail to parse.
replay.py is the primary triage artifact -- the thing a human runs to reproduce a kept
crash outside the fuzzer -- and the failure is silent: the crash dir looks complete and
nothing surfaces until someone tries to replay it, possibly months later.
The existing end-to-end test (test_generated_script_is_valid_python) could not catch this
because its fixture env has no empty values, so the added tests assert on formatPath
directly and exec the emitted env block.
Verified on a fresh PyPy crash dir: replay.py now parses and `replay.py --help` runs.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WhcpLoyjUWLbETGZnA9boj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Found while triaging a PyPy fleet — I went to run a crash dir's
replay.pyand it wouldn't parse.The bug
formatPath()builds its result by appending pieces and then joins them. For an emptyvalue nothing is ever appended, so it returns
""and the env-dict emitter writes:SyntaxError.Why it matters more than it looks
fusil sets
DEBUGINFOD_URLS=""in every target child (the llvm-symbolizer workaround,fusil/python/__init__.py:791), so the empty value is the common case, not an edge case.Measured across the existing runs under
/home/fusil/runs: 60 of 60 sampledreplay.pyfiles fail to parse — apsw, OOM, TSan, PyPy alike.
replay.pyis the primary triage artifact — the thing a human runs to reproduce a kept crashoutside the fuzzer. The failure is silent: the crash dir looks complete, and nothing surfaces
until someone actually tries to replay it, possibly long after the run.
Tests
The existing
test_generated_script_is_valid_pythoncould not catch this — its fixture envhas no empty values. Added three tests to
tests/test_replay_python.py(kept alongside theexisting 34, not replacing them), verified to fail without the fix:
test_empty_str_is_a_valid_expression/test_empty_bytes_is_a_valid_expressiontest_env_dict_with_empty_value_is_parseable— execs the emitted env blockVerified end-to-end on a fresh PyPy crash dir:
replay.pynow parses andreplay.py --helpruns. Full suite green (1252); ruff clean.
🤖 Generated with Claude Code