Bug 66124 - Apache newer than 2.4.52 does not work with mod_php56 (5.6.40)
Summary: Apache newer than 2.4.52 does not work with mod_php56 (5.6.40)
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.4.53
Hardware: PC FreeBSD
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-15 20:18 UTC by Alexander Sheiko
Modified: 2022-06-19 21:46 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Sheiko 2022-06-15 20:18:38 UTC
Apache newer than 2.4.52 does not work with mod_php56 (5.6.40):

[Wed Jun 15 22:45:28.598120 2022] [mpm_event:notice] [pid 79088:tid 545689600] AH00489: Apache/2.4.54 (FreeBSD) OpenSSL/1.1.1l-freebsd configured -- resuming normal operations
[Wed Jun 15 22:45:28.598414 2022] [core:notice] [pid 79088:tid 545689600] AH00094: Command line: '/usr/local/sbin/httpd'
[Wed Jun 15 22:45:32.702955 2022] [core:notice] [pid 79088:tid 545689600] AH00052: child pid 79089 exit signal Segmentation fault (11)
[Wed Jun 15 22:45:33.731537 2022] [core:notice] [pid 79088:tid 545689600] AH00052: child pid 79096 exit signal Segmentation fault (11)
[Wed Jun 15 22:45:33.734173 2022] [core:notice] [pid 79088:tid 545689600] AH00052: child pid 79090 exit signal Segmentation fault (11)

Please restore compatibility that was lost after version 2.4.52.
Comment 1 Rainer Jung 2022-06-16 09:58:21 UTC
Typical PHP builds are not thread-safe (except on Windows), so you must use the prefork MPM, not the event MPM which you are using due to your log snippet. Please change your LoadModule lines to load mpm_prefork instead of mpm_event and try again. Let us know, if it works then.

Thanks and regards,

Rainer
Comment 2 Alexander Sheiko 2022-06-16 12:30:32 UTC
I use mod_php56 with option "Thread Safety => enabled". It worked perfectly on all versions of event MPM Apache 2.4.xx to 2.4.52 inclusive. After the next update to the version 2.4.53(54), problems began.

With prefork MPM I see the same problem:

[Thu Jun 16 15:10:09.695047 2022] [mpm_prefork:notice] [pid 18512] AH00163: Apache/2.4.54 (FreeBSD) OpenSSL/1.1.1l-freebsd configured -- resuming normal operations
[Thu Jun 16 15:10:09.695222 2022] [core:notice] [pid 18512] AH00094: Command line: '/usr/local/sbin/httpd'
[Thu Jun 16 15:10:29.241614 2022] [:error] [pid 18521] [client a.b.c.d:12201] PHP Warning:  session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in /usr/local/www/a/b/c.php on line 111, referer: https://a/b/d.php
[Thu Jun 16 15:10:35.171805 2022] [:error] [pid 18518] [client a.b.c.d:12204] PHP Warning:  Unknown: open(\x18@\xef\xbf\xbd%\xef\xbf\xbd\xef\xbf\xbd/sess_4s95ac0elj5o50b7euvtcn28a3, O_RDWR) failed: No such file or directory (2) in Unknown on line 0, referer: https://x/y/z.php?abcd
[Thu Jun 16 15:10:35.171918 2022] [:error] [pid 18518] [client a.b.c.d:12204] PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0, referer: https://f/g/h.php?xyz
[Thu Jun 16 15:12:10.044048 2022] [core:notice] [pid 18512] AH00052: child pid 18530 exit signal Segmentation fault (11)
[Thu Jun 16 15:12:16.056110 2022] [core:notice] [pid 18512] AH00052: child pid 18521 exit signal Segmentation fault (11)
[Thu Jun 16 15:12:17.058081 2022] [core:notice] [pid 18512] AH00052: child pid 18515 exit signal Segmentation fault (11)
[Thu Jun 16 15:12:18.059989 2022] [core:notice] [pid 18512] AH00052: child pid 18517 exit signal Segmentation fault (11)
[Thu Jun 16 15:12:19.062076 2022] [core:notice] [pid 18512] AH00052: child pid 18529 exit signal Segmentation fault (11)
[Thu Jun 16 15:12:20.063809 2022] [core:notice] [pid 18512] AH00052: child pid 18520 exit signal Segmentation fault (11)

session.save_path is correct - /tmp

Something was broken in Apache, starting with version 2.4.53.
Comment 3 Reindl Harald 2022-06-19 07:58:10 UTC
running 2.4.54 (prefork) with mod_php 7.4.30 in production on dozens of servers (Fedora) without the slightest issue
Comment 4 Alexander Sheiko 2022-06-19 10:37:43 UTC
We are talking about PHP 5.6(40), which cannot be updated due to specific CMS and other scripts.

Compatibility has been broken since Apache 2.4.53.
Comment 5 Stefan Eissing 2022-06-19 13:24:35 UTC
I am not sure we are in a situation where we can help you. The fact is that PHP 5.6 is end-of-life since December 31, 2018.

As far as we are aware, we have retained backward compatibility in all Apache 2.4.x releases to our API.  

A way forward for you would be to produce core files and analyse where exactly the crashes happen on your system and which components are involved. We *might* find the cause looking at your backtraces. But it might be something which results from php5.6 implementation restrictions/bugs which are not easily remedied.
Comment 6 Rainer Jung 2022-06-19 13:57:42 UTC
For more on how to get a backtrace see:

https://httpd.apache.org/dev/debugging.html

especially "Debugging intermittent crashes".
Comment 7 Alexander Sheiko 2022-06-19 15:35:59 UTC
Stefan Eissing, the problem appeared during the update 2.4.52 => 2.4.53, while strange paths to scripts began to appear in the logs - see above. There should not be such paths - the point is somewhere in this. Paths should be like /tmp/sess_4s95ac0elj5o50b7euvtcn28a3.

As for compatibility - all previous versions of Apache 2.4.x work fine.
Comment 8 Alexander Sheiko 2022-06-19 20:19:02 UTC
Rainer Jung, dumps generation not working:

--
# FreeBSD
mkdir -p /var/coredumps
chmod 777 /var/coredumps                        # for "kern.sugid_coredump=1"
sysctl kern.corefile=/var/coredumps/%U/%N.core
sysctl kern.coredump=1                          # default
--
grep Dump /usr/local/etc/apache24/httpd.conf
CoreDumpDirectory /var/coredumps
--
grep coredumpsize /etc/login.conf
        :coredumpsize=unlimited:\
--
[Sun Jun 19 22:33:07.362798 2022] [mpm_event:notice] [pid 17125:tid 545689600] AH00489: Apache/2.4.54 (FreeBSD) OpenSSL/1.1.1l-freebsd configured -- resuming normal operations
[Sun Jun 19 22:33:07.363150 2022] [core:notice] [pid 17125:tid 545689600] AH00094: Command line: '/usr/local/sbin/httpd'
[Sun Jun 19 22:33:10.368381 2022] [core:notice] [pid 17125:tid 545689600] AH00052: child pid 17127 exit signal Segmentation fault (11)
[Sun Jun 19 22:33:11.371415 2022] [core:notice] [pid 17125:tid 545689600] AH00052: child pid 17133 exit signal Segmentation fault (11)
[Sun Jun 19 22:33:14.379395 2022] [core:notice] [pid 17125:tid 545689600] AH00052: child pid 17134 exit signal Segmentation fault (11)
[Sun Jun 19 22:33:17.386427 2022] [core:notice] [pid 17125:tid 545689600] AH00052: child pid 17135 exit signal Segmentation fault (11)
[Sun Jun 19 22:33:25.602397 2022] [core:notice] [pid 17125:tid 545689600] AH00052: child pid 17137 exit signal Segmentation fault (11)
[Sun Jun 19 22:33:28.610408 2022] [core:notice] [pid 17125:tid 545689600] AH00052: child pid 17138 exit signal Segmentation fault (11)
[Sun Jun 19 22:33:32.620385 2022] [core:notice] [pid 17125:tid 545689600] AH00052: child pid 17139 exit signal Segmentation fault (11)
[Sun Jun 19 22:33:35.628381 2022] [core:notice] [pid 17125:tid 545689600] AH00052: child pid 17140 exit signal Segmentation fault (11)
--
ls -l /var/coredumps/
total 0
Comment 9 Rainer Jung 2022-06-19 20:45:51 UTC
Sorry, don't know much about FreeBSD. Maybe

sysctl.sugid_coredump=1

and check permissions of /var/coredumps?
Comment 10 Alexander Sheiko 2022-06-19 21:46:16 UTC
sysctl kern.sugid_coredump
kern.sugid_coredump: 1

ls -l /var | grep core
drwxrwxrwx   2 root     wheel      512 Jun 19 22:10 coredumps