Repository navigation
fix(jitdump): stop reading at records smaller than their header - #14
Merged
Merged
Conversation
Skipping such a record seeks back onto the same header, so samply spun forever on jitdumps corrupted by CPython forking with unflushed data. Refs COD-4043
GuillaumeLagrange
added a commit
that referenced
this pull request
Oct 30, 2026
* fix(jitdump): stop reading at records smaller than their header Skipping such a record seeks back onto the same header, so samply spun forever on jitdumps corrupted by CPython forking with unflushed data. Refs COD-4043 * test(jitdump): use into_queue_iter after the codspeed rebase
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.
A jitdump record whose
total_sizeis smaller than the 16-byte record header can't be valid.linux-perf-datacomputes its body size astotal_size - 16, which underflows, andskip_next_record()then seeks back onto the same header. Reading the file never terminates, andcodspeed runhangs after the benchmark process exits.CPython produces such files with
-X perf_jit. Onos.fork(), the child flushes the parent's unflushed jitdump buffer into the parent's file, and the parent later writes the same bytes again. The next "header" is then read from the middle of a record. Whether it decodes astotal_size == 0depends on the record layout, so it hangs deterministically for some code and never for other code.Both record loops now stop at such a record and keep the symbols read so far, as for a truncated file:
JitDumpManager(recording)JitDumpIndex::from_reader(--presymbolicate)Testing
0x1400, size0header. Both pass with the fix and time out without it.samply record#2, which hung every time with the stock runner: the patched run completed normally. That run did not reproduce the exact corrupted layout, so the crafted case above is the direct proof.Refs COD-4043