You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2022/02/25 14:47:59 UTC

[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


[Bug 65918] graceful in combination with PHP modules seems leaky and causes static TLS (thread local storage) to overflow

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65918

William A. Rowe Jr. <wr...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from William A. Rowe Jr. <wr...@apache.org> ---
Closing as invalid, refer questions about PHP modules to the PHP project.

-- 
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


[Bug 65918] graceful in combination with PHP modules seems leaky and causes static TLS (thread local storage) to overflow

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65918

--- Comment #1 from Barry Jackson <ze...@zen.co.uk> ---
We have a similar issue in this bug report:

https://bugs.mageia.org/show_bug.cgi?id=30924

Server sometimes fails to re-start after logrotate at 04:02, details are in the
report.

Switching to 'restart' in place of 'reload' in the systemd logrotate command
has acted as a successful workaround:

/bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true

We were averaging about 2 fails per week and now no fails in just over two
weeks.

-- 
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