-
Notifications
You must be signed in to change notification settings - Fork 976
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
GetNextEntryAsync might use too large buffer #845
Comments
The suggested possible fix of checking I arrived here thinking that this bug may be affecting me too, and it shows up looking like #160:
My development team has been sporadically seeing the "Header checksum is invalid" error in one unit test on the same I'm not sure how we're encountering this since the check in tarBuffer.ReadBlockIntAsync should come first. But the sporadic nature of it across multiple machines where each developer has their own local copy of the input zip23x-libc5.tar.gz file makes me think that the ArrayPool.Rent behavior could explain its randomness. I'm going to go back to v1.3.3 to see if stability returns to our test. |
FWIW, after going back to v1.3.3, our test has been stable again for over a month, and no one has seen the "Header checksum is invalid" error again. |
I'm experiencing the same issue, like @menees said, after downgrading to v1.3.3, the "Header checksum is invalid" error is fixed. |
Describe the bug
For TAR files GetNextEntryAsync tries to allocates a byte[] buffer of BlockSize 512, using .Rent():
SharpZipLib/src/ICSharpCode.SharpZipLib/Tar/TarInputStream.cs
Lines 548 to 556 in ff2d7c3
(also at:
SharpZipLib/src/ICSharpCode.SharpZipLib/Tar/TarInputStream.cs
Lines 328 to 333 in ff2d7c3
But
.Rent()
returns at least the requested size.After this, in
TarBuffer.ReadBlockIntAsync()
checkes if buffer size is exactly the same as the requested BlockSize.Sometimes headerBuf becomes larger than the requested TarBuffer.BlockSize (in my case 1024) and the ArgumentException("BUG: buffer must have length BlockSize") is thrown.
Possible fix:
Reproduction Code
No response
Steps to reproduce
N/A
Expected behavior
No exception for larger buffers
Operating System
No response
Framework Version
No response
Tags
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: