Open hhyyrylainen opened 1 year ago
The gzip issue is related to this problem with mono, not sure how we should work around that... Perhaps some special runtime checks need to be performed to avoid it... https://github.com/mono/mono/issues/12603
The tar issue is probably related to some other bugs in tar that have been really hard to reproduce, bit this gives me another lead, thanks!
I see, mono is being problematic again... Luckily we might at some point actually be able to update to Godot Engine 4.0 and get on the .NET 7 runtime, which will solve also other really persistent bugs with mono we get somewhat regular reports about.
The tar issue is probably related to some other bugs in tar that have been really hard to reproduce, bit this gives me another lead, thanks!
I had testing from other team members and it seems that the tar reader and writer work correctly when used in combination with the C# standard gzip stream type. Or again, the problem is just so rare that we won't see it happening before this change is included in a public release of ours.
Describe the bug
I'm seeing issues in both reading data and writing data after updating this library from 1.3.3 to 1.4.2 (I think also an earlier 1.4.x version had similar issues).
For reading I randomly see the following issue (I use sync reading):
I assume the exception
BUG: buffer must have length BlockSize
means that there is likely a bug in this library?The other issue is in writing data, I use this in a game using Godot engine which means that the mono runtime is used, which might be the cause of this exception:
I tried looking but there doesn't seem to be a
GZipOutputStream
constructor that takes in an encoding object.Reproduction Code
No response
Steps to reproduce
Try to write a tar.gz file in the following way:
https://github.com/Revolutionary-Games/Thrive/blob/a8ad16dfd02cda02839158149546b0362644f6c3/src/saving/Save.cs#L242
Or try to read such a created file like this (normal tar on my system can extract the file perfectly, which I think indicates that the 1.3.3 created file is fully correct): https://github.com/Revolutionary-Games/Thrive/blob/a8ad16dfd02cda02839158149546b0362644f6c3/src/saving/Save.cs#L328
Expected behavior
I expect that the code, which I linked above, would work in version 1.4.2. I hope I didn't use the library incorrectly, which is possible. I tried searching but I didn't find any porting guide for what changes I would need to make to keep my code working with 1.4.2 version.
Operating System
Linux
Framework Version
Other
Tags
GZip, Tar
Additional context
Update: I tried switching out the gzip layer from this library for the .NET system one and with that everything seems to work correctly. Or at least the error is so rare that I didn't manage to see it from a couple of testing runs. So maybe the issue is reading a combined tar and gzip (from this library) stream in a sync manner?