php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27735 restart of apache2 via kill -1 or apachectl causes crash
Submitted: 2004-03-27 13:45 UTC Modified: 2004-04-16 08:32 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: as at netoholic dot de Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4.3.5 / 4.3.6 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: as at netoholic dot de
New email:
PHP Version: OS:

 

 [2004-03-27 13:45 UTC] as at netoholic dot de
Description:
------------
any time kill -1 at the httpd for configuration reload crashes httpd, log entry
"[notice] seg fault or similar nasty error detected in the parent process"

php built as module against apache 2.0.49 with gcc 3.3.3 on SuSE 8.2 Distibution

configure line:

'./configure' '--prefix=/opt/php-httpd' '--enable-magic-quotes' '--enable-bcmath' '--enable-ftp' '--enable-inline-optimizations' '--enable-memory-limit' '--enable-exif' '--with-apxs2=/opt/apache2/bin/apxs' '--with-openssl' '--with-bz2' '--with-zlib' '--with-mysql' '--enable-calendar' '--enable-dbx' '--with-gd' '--with-gd-native-ttf' '--with-jpeg-dir=/usr/lib' '--with-png-dir=/usr/lib' '--with-zlib' '--with-freetype-dir=/usr/lib' '--enable-dba'

4.3.4 with identical config runs fine...



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-28 11:17 UTC] krasnov at euroweb dot ru
This nasty bug also is being reproduced under FreeBSD 4.8 RELEASE when I try linuxthreads for apache worker thread model.

Either HUP or graceful restart of apache 2.0.49 causes log entry like "[notice] seg fault or similar nasty error detected in the parent process"

CFLAGS='-O -pipe -march=pentiumpro -DZTS -D__USE_UNIX98 -D_REENTRANT -D_THREAD_SAFE -DHAVE_BROKEN_REALPATH -I/usr/local
/include/pthread/linuxthreads -L/usr/local/lib -llthread -llgcc_r' \
LIBS='-L/usr/local/lib -llthread -llgcc_r' \
./configure \
        --prefix=/usr/local/php \
        --with-apxs2=/usr/local/apache2/bin/apxs \
        --with-openssl \
        --with-mysql=/usr/local/mysql \
        --with-zlib \
        --with-gd \
        --with-jpeg-dir=/usr/local/lib \
        --with-png-dir=/usr/local/lib \
        --with-imap=/usr/local/src/imap-2002d \
        --with-imap-ssl=/usr \
        --with-gettext \
        --with-xml \
        --with-tsrm-pthreads

4.3.4 with identical config runs fine...

PS: Native FreeBSD 4.8 pthreads run also fine.
 [2004-03-28 11:31 UTC] krasnov at euroweb dot ru
I must notify you that a cannot reproduce this bug when I add --enable-debug to ./configure
 [2004-03-28 11:44 UTC] krasnov at euroweb dot ru
A little addition: EVERY test made by "make test" after compilation got FAILED.
 [2004-03-28 19:43 UTC] iliaa@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.


 [2004-03-29 05:03 UTC] krasnov at euroweb dot ru
It is awful but all my attempts to core PHP 4.3.5 with --enable-debug were failed.

But in release mode CGI part cores even when it reads php.ini file during "make test".

And mod_php behaves as written before...

Here is the part of core file after "make test" (sorry but without debug).

#0  0x808644f in ?? ()
#1  0x808605e in ?? ()
#2  0x808856f in ?? ()
#3  0x80886c3 in ?? ()
#4  0x8088649 in ?? ()
#5  0x80886c3 in ?? ()
#6  0x8088649 in ?? ()
#7  0x80886c3 in ?? ()
#8  0x8088649 in ?? ()
#9  0x80886c3 in ?? ()
#10 0x8088649 in ?? ()
#11 0x80886c3 in ?? ()
#12 0x8088649 in ?? ()
#13 0x80886c3 in ?? ()
#14 0x8088649 in ?? ()
#15 0x80886c3 in ?? ()
#16 0x8088649 in ?? ()
#17 0x80886c3 in ?? ()
#18 0x8088649 in ?? ()
#19 0x80886c3 in ?? ()
#20 0x8088649 in ?? ()
#21 0x80886c3 in ?? ()
#22 0x8088649 in ?? ()
#23 0x80886c3 in ?? ()
#24 0x8088649 in ?? ()
#25 0x80886c3 in ?? ()
#26 0x8088649 in ?? ()
#27 0x80886c3 in ?? ()
#28 0x8088649 in ?? ()
#29 0x80886c3 in ?? ()
#30 0x8088649 in ?? ()
#31 0x80886c3 in ?? ()
#32 0x8088649 in ?? ()
#33 0x80886c3 in ?? ()
#34 0x8088649 in ?? ()
#35 0x80886c3 in ?? ()
#36 0x8088649 in ?? ()
#37 0x80886c3 in ?? ()
#38 0x8088649 in ?? ()
#39 0x80886c3 in ?? ()
#40 0x8088649 in ?? ()
#41 0x80886c3 in ?? ()
#42 0x8088649 in ?? ()
#43 0x80886c3 in ?? ()
#44 0x8088649 in ?? ()
#45 0x80886c3 in ?? ()
 [2004-03-29 05:25 UTC] as at netoholic dot de
my backtrace:

(gdb) bt
#0  0x4b8f2630 in ?? ()
#1  0x080728a1 in regex_cleanup (preg=0x0) at util.c:258
#2  0x4b56c39d in run_cleanups (cref=0x80ac838) at apr_pools.c:1951
#3  0x4b56bbe9 in apr_pool_clear (pool=0x80ac828) at apr_pools.c:693
#4  0x0806e4d2 in main (argc=4, argv=0xb1d38f34) at main.c:574
#5  0x4b6558ae in __libc_start_main () from /lib/libc.so.6

apache built with prefork mpm...
 [2004-03-29 10:45 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

The backtrace shows the crash to reside deep inside AP2 
code and not in PHP, hence this is not a PHP bug. 
 [2004-03-29 10:45 UTC] iliaa@php.net
read above comment. 
 [2004-03-30 06:57 UTC] chb at muc dot de
I don't think this bug is "Bogus".

I'm experiencing the same problems using Apache 2.0.49 with RedHat Linux 8.0 (same backtrace, ...).

So far I've been able to track it down to the PCRE extension. When I add "--without-pcre" everything is fine.

I've now replaced "ext/pcre", using the version from PHP 4.3.4 (PCRE 4.3) and the problem is gone.

My suspicion is that the new PCRE version has memory allocation problems.
 [2004-03-30 08:50 UTC] noackjr at alumni dot rice dot edu
I have this exact same problem (identical backtrace, etc.) with FreeBSD 5.2.1, Apache 2.0.49, and PHP 4.3.5.  Reverting to the PCRE from 4.3.4 (replacing ext/pcre) also resolved the problem for me.

Does PCRE 4.5 expose an Apache bug, or is this a problem with PCRE 4.5?  If it's the former, leave it as Bogus.  Otherwise, this is a PHP bug because it's bundled code.
 [2004-03-30 22:59 UTC] josestefan at hotmail dot com
I've noticed that disabling all CustomLog in apache's httpd conf file avoids the crash. So maybe that's a good place for the developers to start looking. 

I have log_errors = Off on my php.ini file, so it really doesn't make sense to me. But I have confirmed that with the CustomLogs disabled, I get no crashes.

running Windows XP, Apache: 2.0.49, PHP: 4.3.5
 [2004-03-31 00:00 UTC] josestefan at hotmail dot com
sorry, my report is wrong. I forgot that the error occurs after the first php request, when I did my testing.
 [2004-03-31 05:53 UTC] js at iksz dot hu
Nor FreeBSD, nor Linux libc checks whether regfree() got 
a null pointer.  These bugs should be filtered in libc 
level.
 [2004-03-31 15:30 UTC] noackjr at alumni dot rice dot edu
This wasn't "Bogus", as expected.  It's fixed in CVS according to Bug 27810:
http://bugs.php.net/bug.php?id=27810
 [2004-04-16 05:58 UTC] as at netoholic dot de
Still present in 4.3.6...

Hello Devs, anybody there ???

Read also http://bugs.php.net/bug.php?id=27810
 [2004-04-16 08:32 UTC] derick@php.net
One of those bugs is good enough. Leave this one BOGUS.
 [2004-04-19 18:42 UTC] remco at linux-adept dot nl
Using PHP 4.3.5 or 4.3.6 crashes my Apache 2.0.49 doing a 'apachectl
graceful'. Which is a kill for logrotation! Everything was fine untill
4.3.5 came along. Changing back to 4.3.4 solves the problem.
I have tried recompiling apache etc. Nothing helps.
Gracefully restarting apache gives the following in the error-logs:
[Mon Apr 19 18:28:10 2004] [notice] Graceful restart requested, doing
restart
[Mon Apr 19 18:28:10 2004] [notice] seg fault or similar nasty error
detected in the parent process

And apache has to be restarted once more to get it running.
 [2004-05-02 19:08 UTC] warp-9 dot 9 at usa dot net
This is not bogus.  Don't you have a classification of "Duplicate", like Bugzilla?  Apache 2.0.49, php 4.3.6.

<defiant> [2004-05-02@12:30:29] /var/www -> httpd -k restart
<defiant> [2004-05-02@12:30:45] /var/www -> [Sun May 02 12:30:45 2004] [notice] SIGHUP received.  Attempting to restart
[Sun May 02 12:30:45 2004] [notice] seg fault or similar nasty error detected in the parent process

When I comment out the php4 module, it restarts fine!

BUILD_apache script:

#! /bin/bash

CC=gcc \
CFLAGS="-O3 \
    -mcpu=k6-2" \
CXX=gcc \
CXXFLAGS="-O3 \
    -mcpu=k6-2 \
    -felide-constructors \
    -ffixed-ebp \
    -fno-exceptions \
    -fno-rtti" \
\
./configure \
    \
    --enable-layout=Apache \
    --enable-v4-mapped \
    --enable-mods-shared=all \
    --enable-cgid \
    --enable-deflate \
    --enable-cache \
    --enable-file-cache \
    --enable-disk-cache \
    --enable-mem-cache \
    --enable-logio \
    --enable-unique-id \
    --enable-ssl \
    --with-gdbm \
    --enable-suexec \
    --with-suexec-caller=www \
    --with-suexec-docroot=/var/www \
    --with-suexec-gidmin=1000 \
    --with-suexec-uidmin=1000 \
    --with-suexec-userdir=cgi-bin


BUILD_php4 script:

#! /bin/bash

CC=gcc \
CFLAGS="-O3 \
    -mcpu=k6-2" \
CXX=gcc \
CXXFLAGS="-O3 \
    -mcpu=k6-2 \
    -felide-constructors \
    -ffixed-ebp \
    -fno-exceptions \
    -fno-rtti" \
\
./configure \
  --with-mysql=/usr/local/mysql \
  --with-apxs2

Apache2 using PreFork MPM, so not a thread issue.

As I read on other bug listings, the bug has been isolated to pcre code.  There are reports that it's fixed in CVS.  I'm going to try that momentarily.  There's some reports that those fixes didn't work.  There is also the issue of rolling out development code into production use, when all that is requested from the PHP developers is a set of patch files for 4.3.6 for this specific issue, without potentially introducting more new bugs to the system.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 24 02:01:28 2024 UTC