Skip to content

parse: Consume record-size padding in ParseEvent::End#24

Merged
cgwalters merged 2 commits into
mainfrom
handle-archive-records
May 7, 2026
Merged

parse: Consume record-size padding in ParseEvent::End#24
cgwalters merged 2 commits into
mainfrom
handle-archive-records

Conversation

@cgwalters
Copy link
Copy Markdown
Collaborator

xref https://github.com/composefs/composefs-rs#290

GNU tar and Python's tarfile both pad archives to a record boundary (default 20×512 = 10,240 bytes) after the two mandatory end-of-archive zero blocks. Previously ParseEvent::End only reported consumed: 2×512, leaving the trailing padding bytes unaccounted for.

Normally this doesn't even matter, because callers will only be interested in parsing the stream and discarding the underlying bytes. But composefs wants to do a "splitstream" which preserves those bytes.

Assisted-by: OpenCode (claude-sonnet-4-6@default)

@cgwalters cgwalters force-pushed the handle-archive-records branch from 0746611 to f3ca10f Compare May 7, 2026 17:33
cgwalters added 2 commits May 7, 2026 13:39
xref https://github.com/composefs/composefs-rs#290

GNU tar and Python's tarfile both pad archives to a record boundary
(default 20×512 = 10,240 bytes) after the two mandatory end-of-archive
zero blocks. Previously ParseEvent::End only reported consumed: 2×512,
leaving the trailing padding bytes unaccounted for.

Normally this doesn't even matter, because callers will only
be interested in parsing the stream and discarding the underlying
bytes. But composefs wants to do a "splitstream" which preserves
those bytes.

Assisted-by: OpenCode (claude-sonnet-4-6@default)
Signed-off-by: Colin Walters <walters@verbum.org>
The published lockfile for cargo-fuzz pins rustix 0.36, which uses
rustc_layout_scalar_valid_range_* attributes that nightly ≥ 1.97
(2026-05-03) now reserves for compiler-internal use, causing a compile
error and breaking the fuzz CI job.

Pin to 0.13.1 and drop --locked so cargo resolves fresh deps and picks
up a compatible rustix version. Mirrors the same fix applied in
composefs-rs (commit 7c9a927f).

Assisted-by: OpenCode (claude-sonnet-4-6@default)
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters force-pushed the handle-archive-records branch from 8a7e2df to b80d676 Compare May 7, 2026 17:39
Copy link
Copy Markdown

@jeckersb jeckersb left a comment

Choose a reason for hiding this comment

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

Doesn't appear this repo is currently configured to require 👍 but 👍 nonetheless!

@cgwalters cgwalters merged commit c7b1e98 into main May 7, 2026
5 checks passed
@cgwalters cgwalters deleted the handle-archive-records branch May 7, 2026 21:08
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