Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After upgrading Apache and PHP a certain function causes segmentation fault

I am manually migrating this question from drupal.stackexchange.com (has since been deleted).

I recently upgraded my local dev environment (Vagrant, Ubuntu 12.04) from PHP 5.3.X to 5.5.14 and Apache 2.2.X to 2.4.9. After the upgrade, whenever I the debug function dpm() is called it causes a segmentation fault. A snippet from the Apache logs:

[Wed Jul 09 14:33:11.474063 2014] [core:notice] [pid 6513] AH00051: child pid 6644 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Wed Jul 09 14:33:18.483516 2014] [core:notice] [pid 6513] AH00051: child pid 6640 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Wed Jul 09 14:33:25.494786 2014] [core:notice] [pid 6513] AH00051: child pid 6619 exit signal Segmentation fault (11), possible coredump in /etc/apache2

Note that after upgrading PHP and Apache, I later decided to upgrade Ubuntu to 14.04. The problem remains the same.

Drupal 7.30
Devel 7.x-1.5 (Drupal module)

Disabling OpCache did not solve the problem.

I installed gdb and got a core dump. Here are the results:

/vagrant/web [git::goomba *] [vagrant@dev] [9:04]
> gdb apache2 -core core
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from apache2...(no debugging symbols found)...done.
[New LWP 8265]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/sbin/apache2 -k start'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fd091fda437 in ?? () from /usr/lib/apache2/modules/libphp5.so

And when I run (gdb) backtrace full:

#0  0x00007fd091fda437 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#1  0x00007fd091fdb044 in vspprintf () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#2  0x00007fd092038537 in zend_error_noreturn ()
   from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#3  0x00007fd09205d7ff in zend_std_read_property ()
   from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#4  0x00007fd0920633c7 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#5  0x00007fd0920a7178 in execute_ex () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#6  0x00007fd092027e86 in dtrace_execute_ex ()
   from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#7  0x00007fd0920e2f27 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#8  0x00007fd0920a7178 in execute_ex () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#9  0x00007fd092027e86 in dtrace_execute_ex ()
   from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#10 0x00007fd0920e2f27 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#11 0x00007fd0920a7178 in execute_ex () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#12 0x00007fd092027e86 in dtrace_execute_ex ()

dpm() Details

This is a debug function that pretty-prints a PHP variable. Underneath the hood, it uses Krumo, specifically, it calls krumo::dump().

like image 824
9 revs Avatar asked Aug 14 '14 21:08

9 revs


People also ask

What causes PHP segmentation fault?

Because of the Memory Access Violation, a segmentation fault occurs. The error happens when a software tries to access a memory block that it is not permitted to access. To put it another way, you're approaching a memory location that isn't yours.

What is Apache segmentation fault?

OKay, a segmentation fault is an indication of a program bug; it's not a matter of having too little memory. It occurs when a program tries to access memory it's not allowed to access. If it's happening in Apache, you need to enable core dumps and restart the httpd process.

How can segmentation fault be resolved?

It can be resolved by having a base condition to return from the recursive function. A pointer must point to valid memory before accessing it.


1 Answers

I had a very similar problem here Error (lots of it):

[core:notice] [pid 1550] AH00051: child pid 2226 exit signal Segmentation fault (11), possible coredump in /etc/apache2

the culprit was xcache removed by:

apt-get --purge remove php5-xcache

Using Apache 2.4.7

php -v output:

PHP 5.5.9-1ubuntu4.5 (cli) (built: Oct 29 2014 11:59:10)

like image 78
Braconnot_P Avatar answered Sep 22 '22 02:09

Braconnot_P