Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support decompressing concatenated gzip files #1

Closed
sisong opened this issue Aug 11, 2024 · 5 comments
Closed

support decompressing concatenated gzip files #1

sisong opened this issue Aug 11, 2024 · 5 comments

Comments

@sisong
Copy link
Owner

sisong commented Aug 11, 2024

ref ebiggers#335 (comment)

@sisong
Copy link
Owner Author

sisong commented Aug 12, 2024

@ghuls
it's ok

@sisong sisong closed this as completed Aug 12, 2024
@ghuls
Copy link

ghuls commented Aug 12, 2024

It does not work for all concatenated gzip files. For example compressing the pgzip binary and creating a gzip file with multiple concatenated gzip files, does not work after appending it for the third time.

$ gzip -c pgzip/pgzip > compressed_pgzip_multiple.gz
$ gzip -c pgzip/pgzip >> compressed_pgzip_multiple.gz

# Decompress gzip file with 2 gzip archives.
$ zcat compressed_pgzip_multiple.gz | wc -c
339424

$ pgzip/pgzip -cd compressed_pgzip_multiple.gz | wc -c
339424

$ gzip -c pgzip/pgzip >> compressed_pgzip_multiple.gz

# Decompress gzip file with 3 gzip archives.
$ zcat compressed_pgzip_multiple.gz | wc -c
509136

$ pgzip/pgzip -cd compressed_pgzip_multiple.gz | wc -c
pgzip: 
ERROR: gzips_decompress_by_stream_mt() error code 1


262144

$ build/programs/libdeflate-gzip -cd compressed_pgzip_multiple.gz | wc -c
509136

Another example:

echo 1 | gzip -c > multiple_gzip_header.gz
echo 2 | gzip -c >> multiple_gzip_header.gz
echo 3 | gzip -c >> multiple_gzip_header.gz

$ pgzip/pgzip -cd multiple_gzip_header.gz 
1
2
3

$ echo 4 | gzip -c >> multiple_gzip_header.gz

$ pgzip/pgzip -cd multiple_gzip_header.gz 
pgzip: 
ERROR: gzips_decompress_by_stream_mt() error code 1

@sisong sisong reopened this Aug 12, 2024
@sisong
Copy link
Owner Author

sisong commented Aug 12, 2024

you updated source code to last commit?

@ghuls
Copy link

ghuls commented Aug 12, 2024

you updated source code to last commit?

Yes: 0603f39cf2b003b8e928d11ee27ffd8b8f42de5b

compressed_pgzip_multiple.gz

@sisong
Copy link
Owner Author

sisong commented Aug 12, 2024

Thank you, I fixed this bug

@sisong sisong closed this as completed Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants