php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19639 PHP crashes apache on restart of the webserver
Submitted: 2002-09-27 15:19 UTC Modified: 2002-10-11 11:21 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: wzanatta at uol dot com dot br Assigned:
Status: Closed Package: Apache2 related
PHP Version: 4.2.3 and CVS-snaps OS: Slackware 8.1 - Linux 2.4.19
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wzanatta at uol dot com dot br
New email:
PHP Version: OS:

 

 [2002-09-27 15:19 UTC] wzanatta at uol dot com dot br
  In apache 2.0.40/42 I got the following messages when attempting to *restart* the server.

--------------------------------------------------
[Fri Sep 27 16:54:34 2002] [notice] SIGHUP received.  Attempting to restart
[Fri Sep 27 16:54:34 2002] [notice] Digest: generating secret for digest authentication ...
[Fri Sep 27 16:54:34 2002] [notice] Digest: done
[Fri Sep 27 16:54:35 2002] [notice] seg fault or similar nasty error detected in the parent process
---------------------------------------------------

  I tried PHP versions 4.2.3 and CVS 25/Sep 26/Sep, all combinations giving the same problem.

  If I do a ./apachectl start, the server comes up ok and a phpinfo() show everything normally. The problem only occurs on a restart of the server.

  The backtrace
  ---------------------------------------------------

Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-slackware-linux"...
(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X
[New Thread 1024 (LWP 469)]


Program received signal SIGHUP, Hangup.
[Switching to Thread 1024 (LWP 469)]
_dl_debug_state () at dl-debug.c:57
57      dl-debug.c: No such file or directory.
        in dl-debug.c
(gdb)
(gdb) bt
#0  _dl_debug_state () at dl-debug.c:57
#1  0x400caec6 in dlclose_doit (handle=0x812cfb0) at dlclose.c:25
#2  0x4000a1b0 in _dl_catch_error (objname=0x8129408, errstring=0x812940c,
    operate=0x400caeac <dlclose_doit>, args=0x812cfb0) at dl-error.c:152
#3  0x400cb2a0 in _dlerror_run (operate=0x400caeac <dlclose_doit>,
    args=0x812cfb0) at dlerror.c:130
#4  0x400caef0 in dlclose (handle=0x812cfb0) at dlclose.c:31
#5  0x4005d7ef in dso_cleanup (thedso=0x812b068) at dso.c:110
#6  0x4005c87b in run_cleanups (c=0x8184398) at apr_pools.c:1961
#7  0x4005bacf in apr_pool_clear (pool=0x80f9358) at apr_pools.c:709
#8  0x0807290e in main (argc=2, argv=0xbffff924) at main.c:600
#9  0x400fb17d in __libc_start_main (main=0x8072340 <main>, argc=2,
    ubp_av=0xbffff924, init=0x8065464 <_init>, fini=0x80d74b0 <_fini>,
    rtld_fini=0x4000a534 <_dl_fini>, stack_end=0xbffff91c)
    at ../sysdeps/generic/libc-start.c:129

-----------------------------------------------------------

  My configure lines...

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs  --enable-libgcc --enable-ftp --enable-sockets

  and

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-zlib=shared --with-zlib-dir=shared,/usr/lib --with-bz2=shared,/usr/lib --with-dom=shared,/usr/lib --with-expat-dir=shared,/usr/local/expat --with-dom-xslt=shared,/usr/lib --with-expat-dir=shared,/usr/local/expat --with-dom-exslt=shared,/usr/lib --with-expat-dir=shared,/usr/local/expat --with-gettext=shared,/usr/local/gettext --with-pgsql=shared,/usr/local/postgresql --with-m --with-openssl=shared,/usr/local/openssl --with-gd=shared,/usr/local/gd --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-pear=/usr/local/php/lib/pear --enable-libgcc --enable-dio --enable-ftp --enable-sockets


  Any comments?

William

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-28 04:43 UTC] yohgaki@php.net
Try CVS versions both PHP and Apache2.
Does it help?
 [2002-09-30 08:18 UTC] wzanatta at uol dot com dot br
As I've said before, I've tried apache 2.0.40 and 2.0.42.
Tried PHP 4.2.3, some CVS I don't remember, and the lastest STABLE CVS of that day (php4-STABLE-200209260600).

Also have tried with minimal configuration (just the prefix and the enable parameters) and it didn't work.

A new detail that may be of your interest is that the bug IS NOT reproducible on Solaris 8/SPARC.

Running a standalone apache itself doesn't cause any errors on restart. The problem only occurs when PHP is loaded to Apache.

What about?
 [2002-09-30 18:27 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip

Try that snapshot, NOT the one labeled with 'STABLE' as some fixes possibly related were not merged to that branch.

 [2002-10-01 08:51 UTC] wzanatta at uol dot com dot br
Well the last two CVS versions I tried (one 2 minutes ago and another yesterday) showed me the following error in configure:

checking external libexpat install dir... yes
configure: error: not found. Please reinstall the expat distribution.

This, trying with that second compile (the bigger) line I posted before. Also tried especifying the full path, including the "lib". Another thing to remember is that that directory is under my ld.so.conf and a ldconfig have references to that.

Now compiling with the shortest configure line...
Hmmm seems that works!!!

Just a note, when compiling I got the following message:

ext/mysql/libmysql/my_tempnam.lo: In function `my_tempnam':
/usr/src/ServerSoftware/PHP/php4-200210010300/ext/mysql/libmysql/my_tempnam.c:105: the use of `tempnam' is dangerous, better use `mkstemp'

I'll leave this opened until next thursday and try other compilations, ok?
 [2002-10-01 11:05 UTC] sniper@php.net
Leave this to 'Feedback' status until that so we know it..

Anyway, your configure line is pretty wierd and a bit bad too, for example, you use 'shared' for some options that don't support it (e.g. --with-zlib-dir and --with-expat-dir)
and you use wrong paths for --with-png-dir and --with-jpeg-dir (remove the '/lib' part).

And there's no need to specify --with-expat-dir 3 times..
You could try also configuring non-shared modules and see if it works any better. If so, then try applying the 'shared' part one by one to see where it fails.

 [2002-10-01 11:23 UTC] wzanatta at uol dot com dot br
Oh, sorry.

The 3 times expat may have been a copy/paste problem, my script looks correct.
For the png and jpeg, may have been a messy when trying to compile with gd 2+ support (no way to get it!).
And finally the shared, is because I didn't find references about which options supports it or not.

sorry again...
 [2002-10-03 08:35 UTC] wzanatta at uol dot com dot br
Well I could just make one test. I seems that the bug is solved. However I wasn't able to make full tests because I couldn't compile the CVS snapshot with all the extensions I need. It seems to be tied to gd and zlib. Well both exists and the compilation works for CVS-STABLE versions, so I guess this is not my fault. The CVS-STABLE versions keeps the bug of this thread.

I've got the following error:

<snip>
 In function `php_handle_swc':
/usr/src/ServerSoftware/PHP/php4-200210030300/ext/standard/image.c:224: undefined reference to `uncompress'
/usr/src/ServerSoftware/PHP/php4-200210030300/ext/standard/image.c:243: undefined reference to `uncompress'
main/SAPI.lo: In function `sapi_header_op':
/usr/src/ServerSoftware/PHP/php4-200210030300/main/SAPI.c:522: undefined reference to `zlib_globals'
main/SAPI.lo: In function `sapi_send_headers':
/usr/src/ServerSoftware/PHP/php4-200210030300/main/SAPI.c:669: undefined reference to `zlib_globals'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

</snip>
 [2002-10-03 19:15 UTC] sniper@php.net
Are you trying to compile with --with-zlib=shared.... ?

 [2002-10-07 07:47 UTC] wzanatta at uol dot com dot br
Yes, I'm trying with shared zlib. Isn't it supported? Why?

(compiling with --with-zlib)...

Great! It's compiled and apache didn't crash with restart!

Guess we can close this issue, right?!
 [2002-10-07 18:36 UTC] sniper@php.net
Building zlib as shared module SHOULD work...you just confirmed what I was suspecting to be the bug.

What happens is that we are have some code in that main php libs which rely on zlib been linked with it. And when you compile it as shared extension, zlib is not linked with the main library/binary but only with the extension.

Setting as critical and will look into this soon.

 [2002-10-08 08:14 UTC] wzanatta at uol dot com dot br
Well, don't know whether this one deserves a new issue but let me try...
I got PHP compiled after changing to static zlib support. Now I get the following when I do a 'make install':

(cvs php4-200210071500)
-----------------------------------------------------------
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20020429/
Installing PHP CLI binary:        /usr/local/php/bin/
Installing PEAR environment:      /usr/local/php/lib/pear/
/usr/src/ServerSoftware/PHP/php4-200210071500/sapi/cli/php: relocation error: /usr/local/php/lib/php/extensions/no-debug-non-zts-20020429/xml.so: undefined symbol: XML_ParserCreate
make[1]: *** [install-pear-installer] Error 127
make: *** [install-pear] Error 2
-----------------------------------------------------------

At this time I'm getting the lastest CVS to try again.
 [2002-10-08 08:50 UTC] wzanatta at uol dot com dot br
If helps, isolated the problem on 'make install-pear'...

----------------------------------------------------------
Installing PEAR environment:      /usr/local/php/lib/pear/
/usr/src/ServerSoftware/PHP/php4-200210080300/sapi/cli/php: relocation error: /usr/local/php/lib/php/extensions/no-debug-non-zts-20020429/xml.so: undefined symbol: XML_ParserCreate
make[1]: *** [install-pear-installer] Error 127
make: *** [install-pear] Error 2
----------------------------------------------------------
 [2002-10-09 07:56 UTC] thejoyoflinux at yahoo dot com
I have this problem to.  I have to completely stop apache, then start it again to "restart" it.
 [2002-10-11 09:30 UTC] wzanatta at uol dot com dot br
Could not reproduce the apache restart issue on Solaris 7 SPARC. There, it works fine!!!
 [2002-10-11 11:21 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

User reported that the problem has been fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 09:01:26 2024 UTC