You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With version 0.13.2 (and 0.13.1), I get an error when reading a specific deflate stream using the following code:
importrapidgzipimportzlibwithopen('test.bin', 'rb') asfd:
decomp=zlib.decompressobj(-15)
decomp_data=b''whilelen(decomp_data) <40000000:
data=fd.read(1024*1024)
decomp_data+=decomp.decompress(data)
print(decomp_data[30000000])
print(decomp_data[40000000])
withopen('test.bin', 'rb') asfd:
withrapidgzip.open(fd) asfd2:
# If I swap the order of these seeks the error doesn't occurfd2.seek(40000000)
print(fd2.read(1)[0])
fd2.seek(30000000)
print(fd2.read(1)[0])
I get the following output:
25
2
2
Traceback (most recent call last):
File "rapidgzipbug.py", line 19, in <module>
print(fd2.read(1)[0])
File "rapidgzip.pyx", line 502, in rapidgzip._RapidgzipFile.readinto
RuntimeError: [IsalInflateWrapper][Thread 132968515372608] Decoding failed with error code -3: Invalid lookback distance found! Already decoded 4 B. Read 120 B 2 b during the failing isal_inflate from offset 22979651 B 4 b. Bit range to decode: [183837212, 201376656]. BitReader::size: 335544320. Set window size: 0 B.
The text was updated successfully, but these errors were encountered:
Thank you for reporting this bug! I can confirm it. It still works without error using rapidgzip 0.12.1. It happens only when seeking back because decompression can be delegated to ISA-L then. As I feared, the bug was introduced with the window / seek point compression, but the introducing commit was d03d2a2, not the very first window compression commit in 9edb3b9.
Found the bug. I even already had an unreleased fix for it. Sorry for wasting your time by not releasing the fix, I somehow didn't have the thought to do so. The release should be done in the next hour or so (half the CI is suddenly broken for multiple obnoxious reasons) this weekend.
With version 0.13.2 (and 0.13.1), I get an error when reading a specific deflate stream using the following code:
I get the following output:
The text was updated successfully, but these errors were encountered: