Bug #77683 [Opn]: Segfault possibly by strange chars
| From: | danack@php.net | Date: | Fri, 01 Mar 2019 12:27:21 +0000 |
| Subject: | Bug #77683 [Opn]: Segfault possibly by strange chars | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219791@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77683&edit=1
ID: 77683
Updated by: danack@php.net
Reported by: pascal dot nobus at webservice dot be
Summary: Segfault possibly by strange chars
Status: Open
Type: Bug
Package: *General Issues
Operating System: Slackware 14.1
PHP Version: 7.1.26
Block user comment: N
Private report: N
New Comment:
> there is nog imagemagic on this system.
Whether or not ImageMagick is on the system, something is called putenv with the string
"MAGICK_THREAD_LIMIT=1". From your crash log:
#1 0x00007f6db12af58e in zif_putenv (execute_data=<optimized out>,
return_value=0x7f6d9eff2730)
at /usr/local/src/php-7.1.26/ext/standard/basic_functions.c:4178
setting = 0x7f6d829f19a8 "MAGICK_THREAD_LIMIT=1"
setting_len = 21
p = 0x7f6d423e0a4b ""
env = 0x7f6d6c02f778
pe = {putenv_string = 0x7f6d8b26b438 "MAGICK_THREAD_LIMIT=1", previous_value =
0x0, key = 0x7f6d423e0a38 "MAGICK_THREAD_LIMIT", key_len = 19}
> so no special things that is calling setlocale.
Again, the crash log says that's exactly where one of the crashes comes from:
#1 0x00007f6db5a80d76 in setlocale () from /lib64/libc.so.6
No symbol table info available.
#2 0x00007f6db12e5de0 in zif_setlocale (execute_data=<optimized out>,
return_value=0x7f6d9bfec640)
For reference, I can see that there are some setlocale calls in Drupal: https://github.com/drupal/core/blob/6864b728155310851b3919e41c0d32941c5e62ae/lib/Drupal/Core/DrupalKernel.php#L1028
It's not guaranteed to be the cause, but seeing as that is where the errors are occurring, it
does seem worth the effort to track these down and try removing them to see if that fixes the
problem.
Previous Comments:
------------------------------------------------------------------------
[2019-03-01 08:52:18] pascal dot nobus at webservice dot be
The segfaults are also occurring on apache mpm-prefork, which is non-threaded
------------------------------------------------------------------------
[2019-03-01 08:28:12] nikic@php.net
Note that thread-safety in PHP 7.0 and 7.1 is pretty thoroughly broken. If you're running in a
threaded environment, then PHP 7.2 (or newer) is needed.
------------------------------------------------------------------------
[2019-03-01 07:15:12] pascal dot nobus at webservice dot be
Danack:
- there is nog imagemagic on this system.
- sites are Wordpress-5.1, Wordpress-4.9.9, Drupal-8.2.6, so no special things that is calling
setlocale.
It seems to me that disabling opcache helped a bit (4 Segfault in 24h, insteadoff 10-20).
Another thought that is was hardware, or the fact that apache is mpm_event (with php compiled as
mod_php) was also ruled out because I see the same effect on other servers (also ones compiled with
mpm_prefork).
------------------------------------------------------------------------
[2019-03-01 03:16:27] danack@php.net
Please could you also try to find what is calling setlocale and seeing if that can be disabled?
------------------------------------------------------------------------
[2019-03-01 03:03:19] danack@php.net
So possibly this might be an altering the environment issue.
One of the stacks appears to be something writing "MAGICK_THREAD_LIMIT=1" into the
environment.
This can also be achieve by editing the policy.xml file that was installed by ImageMagick, that will
be on your system somewhere.
Either editing or adding an entry for thread, like:
<policy domain="resource" name="thread" value="1"/>
Can you try doing that, and seeing if that at least removes those entries from your system?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=77683
--
Edit this bug report at https://bugs.php.net/bug.php?id=77683&edit=1