Skip to content

"gzip filter failed to use preallocated memory" with current zlib-ng #263

@zingaburga

Description

@zingaburga

On nginx 1.26.2 with zlib-ng 2.2.2, I get "gzip filter failed to use preallocated memory" errors in the log.
I'm guessing the previous workarounds for zlib-ng have since broken.

I did see this in the zlib-ng 2.2.0 release notes which might give a hint:

The downside to this is that decompression will now always allocate the maximum required memory (~42KB total on 64-bit platforms), previously it would allocate (and potentially free) memory as needed during decompression.
It also means that applications that replace the alloc/free functions with their own can potentially have some issues (Yes I am looking at you Nginx).

So I'm guessing the issue applies to all zlib-ng >= 2.2.0.

Thanks for reading!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions