php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71492 Segmentation faults all the time
Submitted: 2016-02-01 16:22 UTC Modified: 2016-02-28 04:22 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:-1 (-50.0%)
From: Birman at Cerberox dot com Assigned:
Status: No Feedback Package: PCRE related
PHP Version: 7.0.2 OS: CentOS 7.1.1503
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
21 + 46 = ?
Subscribe to this entry?

 
 [2016-02-01 16:22 UTC] Birman at Cerberox dot com
Description:
------------
Installed php70w package on CentOS. Everything installed fine and Apache 2.4.6 picked it up with no problems and all the web services seem to work. However, when I take a look at the logs, after around 5 minutes it gets spammed with Segmentation faults:

[Mon Feb 01 17:09:47.812393 2016] [core:notice] [pid 12430] AH00052: child pid 12457 exit signal Segmentation fault (11)
[Mon Feb 01 17:13:37.999297 2016] [core:notice] [pid 12430] AH00052: child pid 12605 exit signal Segmentation fault (11)
[Mon Feb 01 17:14:08.027445 2016] [core:notice] [pid 12430] AH00052: child pid 12601 exit signal Segmentation fault (11)

Funny thing is that when using the website, everything seems to be fine, so whatever it is, it doesn't affect the usage (or it's able to recover from it quickly).

Also ran the gdb for you, this is what I got:
Try 1:
Program received signal SIGSEGV, Segmentation fault.
sljit_malloc_exec (size=1968) at /usr/src/debug/php-7.0.2/ext/pcre/pcrelib/sljit/sljitExecAllocator.c:196
196                                     header->prev_size = chunk_size;
(gdb) step

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.

Try 2:
Program received signal SIGSEGV, Segmentation fault.
0x00007fffea3c1e48 in sljit_malloc_exec (size=2032) at /usr/src/debug/php-7.0.2/ext/pcre/pcrelib/sljit/sljitExecAllocator.c:189
189                     if (free_block->size >= size) {
(gdb) step

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-02-03 18:57 UTC] cmb@php.net
-Status: Open +Status: Feedback
 [2016-02-03 18:57 UTC] cmb@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2016-02-03 21:18 UTC] Birman at Cerberox dot com
-Status: Feedback +Status: Open
 [2016-02-03 21:18 UTC] Birman at Cerberox dot com
Hi!

I'm running a big forum software, I have no idea what scripts there are that could be causing this. 

How can I help?
 [2016-02-09 18:15 UTC] cmb@php.net
Have you contacted the developers of this forum software? Maybe
they already have a clue what might go wrong. If you should a file
a bug report with them, please add a link here for reference.

Also I suggest you check the pcre.jit ini setting, and disable it
if that's not already the case. Then check if the segfault still
happens.
 [2016-02-11 07:42 UTC] Birman at Cerberox dot com
Hi!

I'm missing pcre.jit setting in my php.ini file. I don't have any other php versions on the server, because I scraped it all clean before installing php7 and the ini file got placed there by php7 installation.
 [2016-02-11 10:57 UTC] cmb@php.net
-Status: Open +Status: Feedback
 [2016-02-11 10:57 UTC] cmb@php.net
> I'm missing pcre.jit setting in my php.ini file.

Then simply add the following line and try again:

pcre.jit=0
 [2016-02-17 12:01 UTC] Birman at Cerberox dot com
-Status: Feedback +Status: Open
 [2016-02-17 12:01 UTC] Birman at Cerberox dot com
Okay, it's been a bit more than 12 hours now since I did that and there has only been 2 Segmentation fault errors. Before it started spamming it roughly after 5 minutes of starting the service. So it seems that did the trick. 
What is that setting anyway? According to description it seems to be some just-in-time debugger. And there are reports about this setting causing problems with regex. How's that?
 [2016-02-17 12:26 UTC] cmb@php.net
-Status: Open +Status: Feedback -Package: *Web Server problem +Package: PCRE related
 [2016-02-17 12:26 UTC] cmb@php.net
> Okay, it's been a bit more than 12 hours now since I did that
> and there has only been 2 Segmentation fault errors.

Still too many, IMHO.  Can you please add a respective backtrace?

> According to description it seems to be some just-in-time
> debugger.

The manual[1] says:

| Whether PCRE's just-in-time *compilation* is going to be used.

(Emphasis mine.) See also
<http://www.pcre.org/original/doc/html/pcrejit.html>.

Which libpcre version do you use? `echo PCRE_VERSION;` should show
the relevant information.

[1] <http://php.net/manual/en/pcre.configuration.php#ini.pcre.jit>
 [2016-02-28 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 09:01:29 2024 UTC