mirror of
https://github.com/google/brotli.git
synced 2026-07-09 02:08:06 +00:00
Compressing specific file at q=4 broken on x86_64-w64-mingw32 since specific commit #67
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @fasterthanlime on GitHub (Nov 12, 2015).
Running this:
bro.exeis a 64-bit (PE32+) binary compiled using mingw-gcc (tested with v4.6 & v5.2)butler.exeis the file contained in that 7z archive: https://misc.amos.me/butler/windows-amd64/v0.4.5/butler.7z (no need to trust/run the .exe, it's just a sample file to be compressed by brotli)...fails starting with
ea48ce5a6f, with the following message:Compiling+running with
#define BIT_WRITER_DEBUGuncommented yields the following last few lines:I think
1UL << 36might be overflowing on Windows, where unsigned longs seem to.. remain 32-bit ? (cf. http://stackoverflow.com/questions/384502/what-is-the-bit-size-of-long-on-64-bit-windows)It might be worth using explicitly-sized types throughout the brotli codebase, I've never seen a large-scale "replace int with size_t" refactor go well :)
@fasterthanlime commented on GitHub (Nov 12, 2015):
Replacing
1ULwith1ULLin the assert inenc/write_bits.hseems to fix it.@eustas commented on GitHub (Nov 12, 2015):
Hello.
Thank you for the report. Most probably this affects not only mingw, but some other compilers.
And, again, we are very grateful for the proposed fix.
I believe, the fix will be landed tomorrow.
Best regards,
Eugene.
@szabadka commented on GitHub (Nov 12, 2015):
This was fixed in PR #266
@fasterthanlime commented on GitHub (Nov 12, 2015):
Thanks a lot for the quick fix! 🌟