C: Compressing large input data triggers an assert (with BROTLI_DEBUG=1) #563

Open
opened 2026-01-29 20:45:53 +00:00 by claunia · 2 comments
Owner

Originally created by @niklasalbers on GitHub (Nov 17, 2025).

Trying to compress large input data triggers an assert:
enc/hash_longest_match64_simd_inc.h:198: FindLongestMatchH68: Assertion `cur_ix_masked + max_length <= ring_buffer_mask' failed.

If quality is set to 6, input data larger than 33554431 bytes will trigger the assert.
If I reduce BROTLI_PARAM_LGWIN / --lgwin, the assert will be triggered for smaller data sizes.

I was not able to reproduce it with version 1.1.0.

How to reproduce:

  1. Compile with BROTLI_DEBUG=1.
  2. head -c 33554432 /dev/urandom > large-file && brotli --quality=6 --force large-file --output=large-file.out
  3. head -c 8388607 /dev/urandom > large-file && brotli --quality=6 --force large-file --output=large-file.out --lgwin=21
Originally created by @niklasalbers on GitHub (Nov 17, 2025). Trying to compress large input data triggers an assert: ```enc/hash_longest_match64_simd_inc.h:198: FindLongestMatchH68: Assertion `cur_ix_masked + max_length <= ring_buffer_mask' failed.``` If quality is set to 6, input data larger than 33554431 bytes will trigger the assert. If I reduce BROTLI_PARAM_LGWIN / --lgwin, the assert will be triggered for smaller data sizes. I was not able to reproduce it with version 1.1.0. ### How to reproduce: 1. Compile with BROTLI_DEBUG=1. 2. `head -c 33554432 /dev/urandom > large-file && brotli --quality=6 --force large-file --output=large-file.out` 3. `head -c 8388607 /dev/urandom > large-file && brotli --quality=6 --force large-file --output=large-file.out --lgwin=21`
Author
Owner

@eustas commented on GitHub (Nov 17, 2025):

Thanks for reporting, will investigate soon.

@eustas commented on GitHub (Nov 17, 2025): Thanks for reporting, will investigate soon.
Author
Owner

@eustas commented on GitHub (Nov 21, 2025):

There is one-off in DCHECK. Will be fixed soon.

@eustas commented on GitHub (Nov 21, 2025): There is one-off in DCHECK. Will be fixed soon.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#563