Bug #75882 [Fbk]: a simple way for segfaults in threadsafe php just with configuration
| From: | ab@php.net | Date: | Mon, 29 Jan 2018 08:59:10 +0000 |
| Subject: | Bug #75882 [Fbk]: a simple way for segfaults in threadsafe php just with configuration | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-213731@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75882&edit=1
ID: 75882
Updated by: ab@php.net
Reported by: hajo dot locke at gmx dot de
Summary: a simple way for segfaults in threadsafe php just
with configuration
Status: Feedback
Type: Bug
Package: Apache2 related
Operating System: Ubuntu 16.04
PHP Version: 7.2.1
Block user comment: N
Private report: N
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php
for Win32
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2018-01-29 08:58:22] ab@php.net
Thanks for the report. As discussed on the ML, this quick description didn't reproduce any
crash. Please put
- the backtrace you receive
- the concrete configuration reproducing the crash
Thanks.
------------------------------------------------------------------------
[2018-01-29 08:02:36] hajo dot locke at gmx dot de
Description:
------------
This is a easy way to have massive segfaults in threadsafe php, just without code, only
configuration is needed.
- compile a minimal threadsafe libphp7.so and enable thread safety
./configure --disable-all --enable-static --prefix=/usr --with-apxs2=/usr/bin/apxs2
--enable-maintainer-zts
- just load this libphp7.so into apache2. no further configuration needed.
LoadModule php7_module /usr/lib/apache2/modules/libphp7.so
- activate a threadsafe mpm in apache like mpm_worker/mpm_event
a2enmod mpm_event
- add a php_value directive in VHost-Config for this particular VHost along with a php_value
directive in .htaccess in docroot of this VHost.
It is not needed to request a php-file, just requesting a small static file is enough. The smaller
the requested file and higher requests per second the higher is count of segfaults. you can do some
mass-requests with ab from apache2-utils or h2load.
Test script:
---------------
none
Expected result:
----------------
i expect to have no segfaults and every single request should be served fine.
Actual result:
--------------
You will see massive segfaults and failed requests. threadsafe php is currently not able to edit
environment of each request safely.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75882&edit=1