Repository navigation
[release/11.0] Fix GNU sparse 1.0 maps spanning multiple TAR records - #136087
Open
github-actions[bot] wants to merge 2 commits into
Open
github-actions[bot] wants to merge 2 commits into
github-actions[bot] wants to merge 2 commits into
Conversation
<!-- --> Valid GNU sparse 1.0 PAX entries can throw `InvalidDataException` when their embedded sparse map exceeds approximately 1 KiB. The refill-capacity check includes already-consumed bytes that the next refill would discard during compaction. Calculate capacity using only unread bytes. This preserves the fixed 1 KiB buffer, the 1,000,000-segment allocation limit, numeric-line bounds, and record-aligned packed-data positioning. Regression coverage checks exact record boundaries, the reported 1,006-byte and 1,062-byte map sizes, and an 8,193-byte map. It covers sync/async reads and extraction, copied/non-copied data, non-seekable inputs, next-entry alignment, and malformed maps. ### Validation Commands ran through a short `subst` path on Windows x64: - `.\build.cmd clr+libs -rc Release` - passed. - `.\dotnet.cmd build src\libraries\System.Formats.Tar\src\System.Formats.Tar.csproj` - passed for the Windows and Unix target assemblies. - `.\dotnet.cmd build /t:test src\libraries\System.Formats.Tar\tests\System.Formats.Tar.Tests.csproj '/p:XUnitOptions=-class System.Formats.Tar.Tests.TarReader_SparseFileTests'` - 159 cases executed; 32 valid-map cases failed before the fix, and all 159 passed afterward. - `.\dotnet.cmd build /t:test src\libraries\System.Formats.Tar\tests\System.Formats.Tar.Tests.csproj` - all 7,084 standard tests passed, with zero skips. Both original issue archives passed sync/async reading and directory extraction after the fix, with expanded lengths and SHA-256 hashes matching Python `tarfile`. Non-Windows test execution and the multi-gigabyte manual stress project were not run. Fixes: #134980 Resolves #134980 > [!NOTE] > This description was generated by GitHub Copilot. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9b3e8fbb-f56a-48da-9df9-8c67a81584d0
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-formats-tar |
Replace unavailable boolean-data helpers with explicit loops, preserving all 72 sparse-map test combinations. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c955dea7-ec9e-43ec-8843-0c28e701ff58
This branch has not been deployed
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.
Backport of #135626 to release/11.0
/cc @rzikm
Customer Impact
.NET 11.0 added a feature for processing sparse TAR archives, however, a bug in the implementation prevents processing entries with lots of empty segments, requiring use of 3rd party or external tools as a workaround.
Regression
No, new feature in 11.0
Testing
Tests were added for CI verification
Risk
Low, the change is small and well understood.