Ankitprasad Sharma
Ankitprasad Sharma

Reputation: 1

zlib inflate failing with errors like invalid distance too far back/ invalid block type/ invalid stored block lengths

Background: I am trying to deflate an in-memory buffer into a file and inflate it later for debugging. In this case when the logs are flowing at a faster rate (about every millisecond) I see failures like incorrect header check. For low rate logging, no issue is seen.

There is no issue in the memory buffer reads, the logs are fine. only happens when zlib comes into picture.

Need suggestions to root cause this.

To get rid of this I tried raw deflate/inflate, which resulted into different failures as mentioned in the title.

snipped hexdump of first few bytes of the compressed data. (raw deflate + default compression)

1201 0003 6863 7361 6973 0073 8640 a406 ffff ffff 0030 ffff 0000 0000 7074 725f 6765 6620 0000 0000 7274 6361 0065 7467

Upvotes: 0

Views: 142

Answers (0)

Related Questions