php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19877 Apache segmentation faults
Submitted: 2002-10-11 23:33 UTC Modified: 2002-10-12 21:41 UTC
From: matt at dfstudios dot com Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4.2.3 OS: RH Linux 7.2
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: matt at dfstudios dot com
New email:
PHP Version: OS:

 

 [2002-10-11 23:33 UTC] matt at dfstudios dot com
I was using Apache 1.3.26 with PHP 4.2.1 for about 3 months with no problems, then one day I discovered unable to access certain PHP pages (IE would give me a Cannot Find Server error). In my error logs I get lines like this:

[Fri Oct 11 21:10:55 2002] [notice] Apache/1.3.26 (Unix) PHP/4.2.1 configured -- resuming normal operations
[Fri Oct 11 21:10:55 2002] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Fri Oct 11 21:10:59 2002] [notice] child pid 1226 exit signal Segmentation fault (11)
[Fri Oct 11 21:15:18 2002] [notice] caught SIGTERM, shutting down
[Fri Oct 11 23:32:27 2002] [notice] Apache/1.3.27 (Unix) PHP/4.2.3 configured -- resuming normal operations
[Fri Oct 11 23:32:27 2002] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Fri Oct 11 23:32:41 2002] [notice] child pid 12347 exit signal Segmentation fault (11)
[Fri Oct 11 23:32:41 2002] [notice] child pid 12345 exit signal Segmentation fault (11)
[Fri Oct 11 23:32:42 2002] [notice] child pid 12348 exit signal Segmentation fault (11)
[Fri Oct 11 23:32:42 2002] [notice] child pid 12346 exit signal Segmentation fault (11)

I tried restarting apache (using both restart and stop/start), then rebooting my server, then recompiling and reinstalling both PHP and Apache (you can see in the error log how the version changes from 1.3.26/4.2.1 to 1.3.27/4.2.3) but nothing seemed to work. 

Other PHP scripts (including phpMyAdmin) work fine. The only difference I can see between the "offending" script and my functional ones is the broken one uses session_decode() and header(). As far as I know, everything was working fine until today. The only change was about a month ago, when I recompiled PHP and added in support for GD, Jpeg-6b, zlib and ldap. Could one of those be the source of error?

My configure line is: 
./configure --with-mysql --with-jpeg-dir=/root/jpeg-6b --with-gd --with-zlib --with-ldap --with-apache=/root/apache_1.3.27 --enable-track-vars --enable-trans-sid --enable-sigchild --enable-ftp --enable-debug --enable-sockets 

I tried diagnosing the problem using gdb but this is all I got:

(gdb) run -X
Starting program: /www/bin/httpd -X

Program received signal SIGTRAP, Trace/breakpoint trap.
0x40001e90 in _start () at rtld.c:160
160     rtld.c: No such file or directory.
        in rtld.c
(gdb)

Nothing came up when I accessed the "culprit" scripts. The one error that I can see there occured immediately at the start and in both versions of Apache/PHP.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-12 02:18 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 first the snapshot. If it crashes too:
Just in case you didn't read this: 

http://bugs.php.net/bugs-generating-backtrace.php

(add --enable-debug to your configure line)

Also, did you update your php.ini at any time?
And could you please add the shortest possible
example script here which can be used to reproduce this problem..

 [2002-10-12 13:02 UTC] matt at dfstudios dot com
I've managed to resolve the problem. First I recompiled php without ldap, zlib or the image library options and recompiled Apache from scratch with the new PHP. That produced no effect. However, recompiling from the 4.3.0-dev source (CVS snapshot) fixed the error.
 [2002-10-12 13:08 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 reports that the problem has been resolved in the CVS.
 [2002-10-12 14:11 UTC] matt at dfstudios dot com
I need to re-open this bug as I've discovered that using 4.3.0 is not a valid solution for me. Rather than fixing the problem it seems to simply abort execution of functions as they begin to crash, meaning that no output is generated and in the end I'm no better off. 

I have determined that session_decode() is the source of the error, here's a gdb backtrace:

(gdb) continue
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x400ce271 in php_set_session_var (name=0x80bb134 "player_id", namelen=9, 
    state_val=0x80bb174, var_hash=0xbfffa528) at session.c:290
290                             zend_set_hash_symbol(state_val, name, namelen, 1, 2, Z_ARRVAL_P(PS(http_session_vars)), &EG(symbol_table));
(gdb) bt
#0  0x400ce271 in php_set_session_var (name=0x80bb134 "player_id", namelen=9, 
    state_val=0x80bb174, var_hash=0xbfffa528) at session.c:290
#1  0x400ce83e in __lock_checklocker () at session.c:441
#2  0x400cea49 in php_session_decode (
    val=0x80baf54 "id|s:1:\"1\";name|s:8:\"Specterx\";cont_id|s:1:\"1\";", vallen=184)
    at session.c:490
#3  0x400d13ac in log_archive () at session.c:1340
#4  0x4017ef27 in new_heap (size=134983936) at malloc.c:2118
#5  0x4015a126 in zend_execute_scripts () at printf_fp.c:241
#6  0x400a0c42 in php_execute_script (primary_file=0xbfffe830) at main.c:1383
#7  0x401657aa in apache_php_module_main () at psignal.c:62
#8  0x4009ce74 in nis_clone_object (src=0x80a6dc4, dest=0x0)
    at nis_clone_obj.c:34
#9  0x4009cee1 in send_parsed_php () at nis_clone_obj.c:59
#10 0x40189577 in ap_invoke_handler () at argz-replace.c:125
#11 0x401a0b1f in process_request_internal () at ../stdlib/strtod.c:906
#12 0x401a0b93 in ap_process_request () at ../stdlib/strtod.c:1006
#13 0x40196ab5 in child_main () at ../stdlib/strtod.c:294
#14 0x40196c80 in make_child () at ../stdlib/strtod.c:938
#15 0x40196e14 in startup_children () at ../stdlib/strtod.c:807
#16 0x4019754a in __wcstof_internal (nptr=0x2, endptr=0xbfffeca4, 
---Type <return> to continue, or q <return> to quit---
    group=-1073746920) at ../stdlib/strtod.c:603
#17 0x40197f5e in ap_main () at ../stdlib/strtod.c:283
#18 0x08048711 in ?? ()
#19 0x4031d627 in ?? (), 
(gdb) frame 2
#2  0x400cea49 in php_session_decode (
    val=0x80baf54 "id|s:1:\"1\";name|s:8:\"Specterx\";cont_id|s:1:\"1\";", vallen=184)
    at session.c:490
490             if (PS(serializer)->decode(val, vallen TSRMLS_CC) == FAILURE) {
(gdb) Quit  

I tested my theory by commenting out the call to session_decode() in the offending script and manually setting the variables that I needed instead. Lo and behold, it worked. 

Up to this point I have rebooted my server at least twice and recompiled and reinstalled PHP and Apache numerous times.
 [2002-10-12 21:41 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in PHP.


Bogusing this since you opened new report about the real issue..and this segfault was obviously fixed in the CVS.
Please, just one report per issue, thank you.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 10:01:28 2024 UTC