unable to init Zlib

36 views
Skip to first unread message

Lewis G Rosenthal

unread,
Jan 19, 2023, 5:03:20 PM1/19/23
to Apache2 Mailing List
Apache 2.4.54
PHP 7.4.32
WordPress 6.1.1
WooCommerce 7.3.0

I'm getting tons of entries such as the one below for various URLs which are
supposed to be compressed:

[Thu Jan 19 12:29:36.975000 2023] [deflate:error] [pid 134:tid 11] [client
xxx.xxx.xxx.xxx:xxxxx] AH01383: unable to init Zlib: deflateInit2 returned
-4: URL /wp-includes/js/dist/vendor/react.min.js, referer:
https://www.domain.com/page/

mod_deflate.dll seems to have everything it wants to load, so there's no
issue there.

--
Lewis
-------------------------------------------------------------
Lewis G Rosenthal, CNA, CLP, CLE, CWTS, EA
Rosenthal & Rosenthal, LLC www.2rosenthals.com
visit my IT blog www.2rosenthals.net/wordpress
-------------------------------------------------------------

Steven Levine

unread,
Jan 19, 2023, 10:00:55 PM1/19/23
to apa...@googlegroups.com
In <63C9BE23...@2rosenthals.com>, on 01/19/23
at 05:03 PM, Lewis G Rosenthal <lgros...@2rosenthals.com> said:

Hi Lewis,

>[Thu Jan 19 12:29:36.975000 2023] [deflate:error] [pid 134:tid 11]
>[client xxx.xxx.xxx.xxx:xxxxx] AH01383: unable to init Zlib:
>deflateInit2 returned -4: URL /wp-includes/js/dist/vendor/react.min.js,
>referer: https://www.domain.com/page/

>mod_deflate.dll seems to have everything it wants to load, so there's no
>issue there.

-4 is Z_MEM_ERROR, so we have to suspect you are OOM or there is something
wrong with that parameters passed to deflateInit2_ which is near

deflate.c:216
int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel,
strategy,

in the zlib sources. The call is at

modules\filters\mod_deflate.c:762
zRC = deflateInit2(&ctx->stream, c->compressionlevel,
Z_DEFLATED,
c->windowSize, c->memlevel,
Z_DEFAULT_STRATEGY);

To figure out what is going on we might need to tweak

modules\filters\mod_deflate.c:768
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01383)
"unable to init Zlib: "
"deflateInit2 returned %d: URL %s",
zRC, r->uri);

to report the parameters passed to deflateInit2. However a quick scan of
the code implied that parameters that matter are constants.

The buffers used by zlib are not that large, so it's somewhat hard to
understand how you could be OOM.

I don't know which version of zlib Paul is building against, so we might
want to make sure it's current.

Steven

--
----------------------------------------------------------------------
"Steven Levine" <ste...@earthlink.net> Warp/DIY/BlueLion etc.
www.scoug.com www.arcanoae.com www.warpcave.com
----------------------------------------------------------------------

Paul Smedley

unread,
Jan 26, 2023, 8:34:18 PM1/26/23
to apa...@googlegroups.com
Hye Guys,

On 20/1/23 13:01, Steven Levine wrote:
> I don't know which version of zlib Paul is building against, so we might
> want to make sure it's current.

12/12/20 15:46 <DIR> 124 ___AD zlib-1.2.11
17/04/22 8:18 <DIR> 124 ___AD zlib-1.2.12

Looks like I was using 1.2.11 up until 17 APR 22, then moved to 1.2.12

Cheers,

Paul

Lewis G Rosenthal

unread,
Jan 27, 2023, 12:11:32 AM1/27/23
to apa...@googlegroups.com
Hi, Paul...
And it looks like the zlib folks are recommending 1.2.13, whihc includes a
fix for CVE-2022-37434:

zlib through 1.2.12 has a heap-based buffer over-read or buffer overflow in
inflate in inflate.c via a large gzip header extra field. NOTE: only
applications that call inflateGetHeader are affected. Some common
applications bundle the affected zlib source code but may be unable to call
inflateGetHeader (e.g., see the nodejs/node reference).

If it's not one thing, it's another.

I don't think this is our problem, however (though more of a security concern).

Steven Levine

unread,
Jan 27, 2023, 12:31:45 AM1/27/23
to apa...@googlegroups.com
In <63D35CF9...@2rosenthals.com>, on 01/27/23
at 12:11 AM, Lewis G Rosenthal <lgros...@2rosenthals.com> said:

Hi all,

>I don't think this is our problem, however (though more of a security
>concern).

It's not. We probably will not know more until we tweak
modules\filters\mod_deflate.c:768 as I suggested. I'll try to remember to
do this when when I put together the next set of debugging patches for our
zend_mm_free_heap issue.

Today got chewed up by the HOA mess.

Yesterday and the day before was my front door.

The front door is almost done. The HOA is and will probably remain a
mess.

Lewis G Rosenthal

unread,
Jan 27, 2023, 12:36:11 AM1/27/23
to apa...@googlegroups.com
On 01/27/23 12:24 am, Steven Levine wrote:
> In <63D35CF9...@2rosenthals.com>, on 01/27/23
> at 12:11 AM, Lewis G Rosenthal <lgros...@2rosenthals.com> said:
>
> Hi all,
>
>> I don't think this is our problem, however (though more of a security
>> concern).
> It's not. We probably will not know more until we tweak
> modules\filters\mod_deflate.c:768 as I suggested. I'll try to remember to
> do this when when I put together the next set of debugging patches for our
> zend_mm_free_heap issue.
>
> Today got chewed up by the HOA mess.
>

Ugh.

> Yesterday and the day before was my front door.
>
> The front door is almost done. The HOA is and will probably remain a
> mess.
>

:-(

These things can be like lingering itches. You rub in some calamine lotion,
feel better, think it's gone away, and shortly after, start itching again.

Celebrate the small victories (the front door). :-)

Paul Smedley

unread,
Jan 27, 2023, 12:45:51 AM1/27/23
to apa...@googlegroups.com
Hey guys,

On 27/1/23 15:41, Lewis G Rosenthal wrote:
> On 01/26/23 08:34 pm, Paul Smedley wrote:
>> Hye Guys,
>>
>> On 20/1/23 13:01, Steven Levine wrote:
>>> I don't know which version of zlib Paul is building against, so we might
>>> want to make sure it's current.
>>
>> 12/12/20  15:46         <DIR>      124   ___AD  zlib-1.2.11
>> 17/04/22   8:18         <DIR>      124   ___AD  zlib-1.2.12
>>
>> Looks like I was using 1.2.11 up until 17 APR 22, then moved to 1.2.12
>>
>
> And it looks like the zlib folks are recommending 1.2.13, whihc includes
> a fix for CVE-2022-37434:

This is now built and will be used for all future builds...

Cheers,

Paul

Lewis G Rosenthal

unread,
Jan 27, 2023, 9:46:31 AM1/27/23
to apa...@googlegroups.com
;-)

Cheers

Steven Levine

unread,
Feb 4, 2023, 6:16:32 PM2/4/23
to apa...@googlegroups.com
In <63D3E3C1...@2rosenthals.com>, on 01/27/23
at 09:46 AM, Lewis G Rosenthal <lgros...@2rosenthals.com> said:

Hi,

>> This is now built and will be used for all future builds...

Did the new build fully resolve this? I've not seen any log entries
recently.

Lewis G Rosenthal

unread,
Feb 4, 2023, 7:23:22 PM2/4/23
to apa...@googlegroups.com
Hi...

On 02/04/23 06:14 pm, Steven Levine wrote:
> In <63D3E3C1...@2rosenthals.com>, on 01/27/23
> at 09:46 AM, Lewis G Rosenthal <lgros...@2rosenthals.com> said:
>
> Hi,
>
>>> This is now built and will be used for all future builds...
> Did the new build fully resolve this? I've not seen any log entries
> recently.
>

I believe so.

It would appear that the last instance we had of being unable to init Zlib was:

[Thu Jan 19 15:42:17.702000 2023] [deflate:error] [pid 103:tid 45] [client
80.3.80.176:55053] AH01383: unable to init Zlib: deflateInit2 returned -4:
URL /wp-includes/js/jquery/jquery.min.js, referer:
https://www.domain.com/

and the last deflate error we had at all was immediately following that:

[Thu Jan 19 16:34:35.318000 2023] [deflate:error] [pid 170:tid 11] [client
70.135.166.98:53062] AH01386: Zlib error -2 deflating data ((null)),
referer: https://www.domain.com/domain/

so I think we're golden on this issue.
Reply all
Reply to author
Forward
0 new messages