php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24012 child pid $pid exit signal Segmentation fault (11)
Submitted: 2003-06-04 05:27 UTC Modified: 2003-06-05 07:38 UTC
From: jp at 2fast dot nl Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 4.3.2 OS: Linux
Private report: No CVE-ID: None
 [2003-06-04 05:27 UTC] jp at 2fast dot nl
On apache 2.0.46 with PHP 4.3.2 i get the following errors in my error_log:

[Wed Jun 04 09:09:24 2003] [notice] child pid 4713 exit signal Segmentation fault (11)
[Wed Jun 04 09:09:39 2003] [notice] child pid 4800 exit signal Segmentation fault (11)
[Wed Jun 04 09:09:45 2003] [notice] child pid 4856 exit signal Segmentation fault (11)
[Wed Jun 04 09:09:58 2003] [notice] child pid 4895 exit signal Segmentation fault (11)
[Wed Jun 04 09:10:00 2003] [notice] child pid 4937 exit signal Segmentation fault (11)

steps i've taken to eliminate hardware failures and other factors:

1. build a new kernel on that machine, previous kernel had a memory mngt. patch: segmentation faults kept coming.

2. build httpd with an other gcc compiler (2.95 instead of 3.3): segmentation faults didn't disappear

3. Compiled it on a whole different machine (AMD Atlhon instead of Intel P4) with the same PHP scripts: It's raining segmentation faults

4. I also compiled php4-STABLE-200306032130 but it makes no difference.

I use debian and on both machines runs Linux 2.4.20 without any patches. My PHP version is 4.3.2 and is build with apxs2. The MPM on apache is worker.

It has also come to my attention that if I use the following MPM settings (ServerLimit 20, TreadsPerChild 35, MaxClients 700) the webserver has a maximum output of 4 mbit/s while with apache 1.3.27 9 mbit/s could been reached. And with the settings (ServerLimit 50, TreadsPerChild 15, MaxClients 750) my webserver died within a few minutes by a segmentation fault on the parent proccess:

[Mon Jun 02 15:59:31 2003] [notice] child pid 11105 exit signal Segmentation fault (11)
[Mon Jun 02 15:59:32 2003] [notice] child pid 11122 exit signal Segmentation fault (11)
[Mon Jun 02 15:59:32 2003] [notice] child pid 11121 exit signal Segmentation fault (11)
[Mon Jun 02 15:59:32 2003] [notice] child pid 11120 exit signal Segmentation fault (11)
[Mon Jun 02 15:59:32 2003] [notice] child pid 11119 exit signal Segmentation fault (11)
[Mon Jun 02 15:59:32 2003] [notice] child pid 11118 exit signal Segmentation fault (11)
[Mon Jun 02 15:59:32 2003] [notice] child pid 11117 exit signal Segmentation fault (11)
[Mon Jun 02 15:59:32 2003] [notice] child pid 11116 exit signal Segmentation fault (11)
[Mon Jun 02 15:59:32 2003] [notice] child pid 11115 exit signal Segmentation fault (11)
[Mon Jun 02 15:59:33 2003] [notice] seg fault or similar nasty error detected in the parent process

I don't get apache coredumps.

When i comment out the loading of the PHP module and the webserver only servers static images i don't get any segmentation faults.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-04 05:56 UTC] derick@php.net
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

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.
 [2003-06-04 10:47 UTC] jp at 2fast dot nl
(gdb) bt
#0  0x401e1a54 in read () from /lib/libc.so.6
#1  0x400e9b50 in __JCR_LIST__ () from /lib/libpthread.so.0
#2  0x08091424 in ap_mpm_pod_check (pod=0x8130528) at pod.c:96
#3  0x0808fbee in child_main (child_num_arg=14) at worker.c:1308
#4  0x0808fd3c in make_child (s=0x80d55f8, slot=14) at worker.c:1391
#5  0x080900e7 in perform_idle_server_maintenance () at worker.c:1552
#6  0x080902bb in server_main_loop (remaining_children_to_start=0) at worker.c:1645
#7  0x08090518 in ap_mpm_run (_pconf=0x80d1f30, plog=0x8114038, s=0x80d55f8) at worker.c:1743
#8  0x080961ae in main (argc=3, argv=0xbffffd64) at main.c:660
(gdb) frame 8
#8  0x080961ae in main (argc=3, argv=0xbffffd64) at main.c:660
660             if (ap_mpm_run(pconf, plog, server_conf))

HTH
 [2003-06-04 22:59 UTC] sniper@php.net
What was the full configure line used to configure PHP?

 [2003-06-05 03:38 UTC] jp at 2fast dot nl
#!/bin/sh
./configure \
--enable-discard-path \
--with-apxs2=/usr/local/httpd/bin/apxs \
--enable-ftp \
--with-mysql \
--with-ttf \
--enable-safe-mode \
--enable-memory-limit \
--with-dbase \
--enable-track-vars \
--with-gd \
--with-jpeg-dir=/usr/local \
--with-png-dir=/usr/local \
--enable-bcmath \
--enable-versioning \
--enable-trans-sid \
--with-zlib \
--with-xml \
--with-dom=/usr/local \
--with-wddx \
--with-mcrypt \
--with-openssl \
--enable-gd-imgstrttf \
--enable-debug \
--enable-calendar
 [2003-06-05 07:38 UTC] sniper@php.net
We can't fix every library out there that isn't thread-safe,
so either don't compile PHP with such extensions that use 
those libraries or run Apache2 with non-threaded MPM.

Safest bet is to use Apache 1.3.27 anyway..

 [2003-06-05 07:38 UTC] sniper@php.net
And the crash does seem to happen inside Apache anyway..


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Nov 27 08:01:27 2024 UTC