Mailing List Archive

[Bug 65918] New: graceful in combination with PHP modules seems leaky and causes static TLS (thread local storage) to overflow
https://bz.apache.org/bugzilla/show_bug.cgi?id=65918

Bug ID: 65918
Summary: graceful in combination with PHP modules seems leaky
and causes static TLS (thread local storage) to
overflow
Product: Apache httpd-2
Version: 2.4.52
Hardware: PC
OS: Linux
Status: NEW
Severity: critical
Priority: P2
Component: Core
Assignee: bugs@httpd.apache.org
Reporter: ct@flyingcircus.io
Target Milestone: ---

I have been debugging an elusive issue where we saw PHP failing after graceful
reloads. This seems to be an issue with the newish static thread local storage
(=TLS, not TLS as in transport layer security) in glibc and various PHP modules
requiring static TLS.

However, this does not happen immediately, but I was able to recreate this
reliably after 3-7 times with a minimal set on PHP 8.0.16.

Variation 1: with only modules imagick + zlib -> leads to a running crippled
Apache with logging something like this:


Feb 25 11:27:51 lamp php[906]: PHP Warning: PHP Startup: Unable to load
dynamic library
'/nix/store/mqa5992cz3z49b0gjw10v4j4xppl9g2d-php-imagick-3.4.4/lib/php/extensions/imagick.so'
(tried:
/nix/store/mqa5992cz3z49b0gjw10v4j4xppl9g2d-php-imagick-3.4.4/lib/php/extensions/imagick.so
(/nix/store/paqfl70z4zxip8lvpsijbspi0y2wzg4i-gcc-10.3.0-lib/lib/libgomp.so.1:
cannot allocate memory in static TLS block),
/nix/store/hp22676f4kbkz9ssbswb6ysczn3d5c1k-php-8.0.13/lib/php/extensions//nix/store/mqa5992cz3z49b0gjw10v4j4xppl9g2d-php-imagick-3.4.4/lib/php/extensions/imagick.so.so
(/nix/store/hp22676f4kbkz9ssbswb6ysczn3d5c1k-php-8.0.13/lib/php/extensions//nix/store/mqa5992cz3z49b0gjw10v4j4xppl9g2d-php-imagick-3.4.4/lib/php/extensions/imagick.so.so:
cannot open shared object file: No such file or directory)) in Unknown on line
0

Variation 2: with only modules imap + zlib

Leads to an exit of Apache and this message:

httpd: Syntax error on line 34 of /etc/httpd/httpd.conf: Cannot load
/nix/store/nw11w7svl37azvy40a1baf9hwsak48h4-php-with-extensions-8.0.16/modules/libphp.so
into server:
/nix/store/nw11w7svl37azvy40a1baf9hwsak48h4-php-with-extensions-8.0.16/modules/libphp.so:
cannot allocate memory in static TLS block

When instructing glibc to use a larger static area I can do more reloads until
it runs out of space again.

There was a PHP bug report from a BSD user that exposed similar behaviour:
https://bugs.php.net/bug.php?id=80814 which I notified about my observation as
well.

In any case, I think this could be an issue that happens due to some
interaction between Apache and PHP and the way that graceful reloads (might)
work.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org