php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10072 SIGSEGV on startup (apxs)
Submitted: 2001-03-29 23:40 UTC Modified: 2001-04-10 09:25 UTC
From: old dot wolf at project-w dot com Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0.4pl1 OS: Solaris 7
Private report: No CVE-ID: None
 [2001-03-29 23:40 UTC] old dot wolf at project-w dot com
OS version:
SunOS ptl2 5.7 Generic sun4u sparc SUNW,Ultra-5_10

Apache 1.3.19+mod_ssl-2.8.1 configure line:
EAPI_MM=../mm-1.1.3 SSL_BASE=../openssl-0.9.6 ./configure --prefix=/usr/local/apache --enable-module=ssl --enable-module=so --enable-module=rewrite 

PHP 4.0.4pl1 configure line:
./configure --with-apxs --with-mcrypt --with-mhash --with-mysql=../../mysql --with-gd --enable-versioning --with-ttf --with-jpeg-dir=../jpeg-6b  --enable-debug

If the LoadModule libphp4.so is removed from httpd.conf, Apache operates correctly. Otherwise, there is a SIGSEGV as httpd starts up. Following is a GDB backtrace and partial truss output. Full truss output can be found at http://wolf.project-w.com/notes/20010330.phpsegv.txt

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

GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.7"...
(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X
warning: Lowest section in /usr/lib/libintl.so.1 is .hash at 00000074

Program received signal SIGSEGV, Segmentation fault.
0xff3b8894 in ?? ()
(gdb) bt
#0  0xff3b8894 in ?? ()
#1  0xff3b35a0 in ?? ()
#2  0xff3b37e8 in ?? ()
#3  0xff3bd154 in ?? ()
#4  0xb7764 in ap_os_dso_load ()
#5  0x83a70 in load_module ()
#6  0x8d550 in invoke_cmd ()
#7  0x8e3c0 in ap_handle_command ()
#8  0x8e49c in ap_srm_command_loop ()
#9  0x8ee84 in ap_process_resource_config ()
#10 0x8facc in ap_read_config ()
#11 0x9e7bc in main ()
(gdb) 

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

...

stat("/usr/local/apache", 0xFFBED7C8)           = 0
open("/usr/local/apache/libexec/libphp4.so", O_RDONLY) = 5
fstat(5, 0xFFBED614)                            = 0
mmap(0x00000000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE, 5, 0) = 0xFF340000
mmap(0x00000000, 2187264, PROT_READ|PROT_EXEC, MAP_PRIVATE, 5, 0) = 0xFED80000
munmap(0xFEF46000, 57344)                       = 0
mmap(0xFEF54000, 182128, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 5, 1851392) = 0xFEF54000

...

mprotect(0xFED80000, 1854910, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
mprotect(0xFED80000, 1854910, PROT_READ|PROT_EXEC) = 0
munmap(0xFEF54000, 265928)                      = 0
munmap(0xFED80000, 1854910)                     = 0
    Incurred fault #6, FLTBOUNDS  %pc = 0xFF3B8894
      siginfo: SIGSEGV SEGV_ACCERR addr=0xFF3CABD4
    Received signal #11, SIGSEGV [default]
      siginfo: SIGSEGV SEGV_ACCERR addr=0xFF3CABD4
        *** process killed ***

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-30 14:37 UTC] sniper@php.net
1. Delete config.cache
2. Add --enable-debug into your configure line
3. Configure and compile and try regenerating that gdb backtrace.

And do not use the source dirs in any other configure
option of PHP than --with-apache. You should be using the
INSTALL base dirs.

--Jani


 [2001-03-30 17:07 UTC] old dot wolf at project-w dot com
I'm not sure what you mean. My PHP configure line already has --enable-debug, and contains no source dirs except jpeg-6b (I can take that out and recompile I guess).
../../mysql = /usr/local/mysql, which is where it installed

Or are you referring to my Apache configure line (the example installation specified to use those source dirs).


 [2001-04-01 13:17 UTC] sniper@php.net
Can you please try the latest CVS snapshot from http://snaps.php.net/ ? 
And I saw some informix related stuff in that truss output
so it might be something left in there. Check your php.ini
and also do 'make clean' after configuring PHP.

--Jani

 [2001-04-03 03:18 UTC] old dot wolf at project-w dot com
I got the latest snap, php4-200104022145, and rebuilt as you suggest. I also used a smaller configure line:

./configure --with-apxs --enable-debug

and got the same segfault. The gdb output is identical, and the truss output is an identical structure but a couple of different mmap base addresses and sizes.

Judging by the gdb, maybe this is a problem with either apxs on Solaris 7, or with PHP's usage of it?

The /x/informix you see in the truss are because of the environment variables:
LD_LIBRARY_PATH=/usr/local/lib
LD_RUN_PATH=:/x/informix/lib/esql:/x/informix/lib

I will try recompiling with the static (non-apxs) form tomorrow.

Matt.

 [2001-04-03 09:06 UTC] sniper@php.net
Which compiler / linker do you use? GNU?

--Jani

 [2001-04-03 20:14 UTC] old dot wolf at project-w dot com
Using latest gcc and gmake, but using Sun's /usr/ccs/bin/ld (1 Sep 1998). I guess the next step is to try GNU ld..

Matt.

 [2001-04-10 09:25 UTC] sniper@php.net
User feedback:
--------------
I recompiled Apache with --enable-rule=SHARED_CORE and now it works
correctly.
(Previously I had enabled mod_so but not SHARED_CORE. I wish they'd tell you
these things..)
--------------

Closed.

--Jani

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