Comments (3)
The suggested possible fix of checking if (buffer.Length < BlockSize)
won't be sufficient because several things downstream assume that the headerBuf array will be exactly 512 bytes. For example, TarHeader.ParseBuffer is passed a byte[] headerBuf
, and it calls TarHeader.MakeCheckSum at the end, which iterates through buffer.Length
. So, if headerBuf is larger than 512 bytes, then the checksum will be wrong.
I arrived here thinking that this bug may be affecting me too, and it shows up looking like #160:
ICSharpCode.SharpZipLib.Tar.TarException: Header checksum is invalid
Stack Trace:
at ICSharpCode.SharpZipLib.Tar.TarInputStream.GetNextEntryAsync(CancellationToken ct, Boolean isAsync)
at ICSharpCode.SharpZipLib.Tar.TarInputStream.GetNextEntry()
My development team has been sporadically seeing the "Header checksum is invalid" error in one unit test on the same
zip23x-libc5.tar.gz input test file for the last month since we upgraded to SharpZipLib v1.4.2. We never saw this with v1.3.3 for the year and a half we were on that version. I've confirmed that we're all using the same version of the input file, and those bytes haven't changed since April 3, 2012.
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.
from sharpziplib.
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.
from sharpziplib.
I'm experiencing the same issue, like @menees said, after downgrading to v1.3.3, the "Header checksum is invalid" error is fixed.
from sharpziplib.
Related Issues (20)
- Reading and writing in sync mode problems after update to 1.4 HOT 2
- Unpacking 7z archive failed. HOT 2
- Perf - Add buffer pooling where relevant
- Use CompressionMethod.Stored and flush the ZipOutputStream after each entity was added leads Zip corrupted in SharpZipLib 1.4.2 HOT 9
- Tar file is empty with a size of zero bytes for small tar entry sizes HOT 4
- Reading deflate file throw "Unexpected EOF" HOT 22
- SharpZipLib v1.4 introduced breaking change
- TAR archive has only 20kb when application high load
- xarchiver can't open tar files created with this library
- Symlink creation not possible with `TarArchive.WriteEntry()`. HOT 1
- .NET Framework 4.6.2 Support?
- Could not load file or assembly 'System.Threading.Tasks.Extensions' or one of its dependencies
- Original DateTime/DosTime value
- TestArchive doesn't handle invalid offsets correctly HOT 2
- It's not possible to tar files starting with "system" in the file name.
- Problem when create zip in network folder
- Add support for .NET Framework 4.6.1 to target frameworks.
- Creating incomplete zip when using zip64.
- Problem reading archives containg Zip64 files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharpziplib.