php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11716 Segmentation fault(coredump) in Apache(DSO-enabled) startup
Submitted: 2001-06-26 21:52 UTC Modified: 2002-11-24 21:59 UTC
Votes:5
Avg. Score:4.4 ± 0.8
Reproduced:4 of 5 (80.0%)
Same Version:3 (75.0%)
Same OS:3 (75.0%)
From: cmlee at users dot sourceforge dot net Assigned:
Status: Closed Package: Apache related
PHP Version: 4.2.2 OS: AIX 4.3.3
Private report: No CVE-ID: None
 [2001-06-26 21:52 UTC] cmlee at users dot sourceforge dot net
IBM AIX 4.3.3
Apache 1.3.20
PHP 4.0.6 Release
GNU gcc 2.95.2 for AIX

$ export CFLAGS="-g"
$ ./configure --enable-debug \
--with-apxs=/home/apache/bin/apxs \
--with-mysql=no
...
$ make
...

$ make install-sapi

$ su

# cd /home/apache/bin
# ./httpd -X
Segmentation fault (core dumped)

# dbx httpd core
Type 'help' for help.
reading symbolic information ...
[using memory image in core]

Segmentation fault in php_if_apache_lookup_uri at 0xd14e5658 ($t1)
0xd14e5658 (php_if_apache_lookup_uri+0x554) 800c0000        lwz   r0,0x0(r12)
(dbx) where
php_if_apache_lookup_uri() at 0xd14e5658
php_create_dir(??, ??) at 0xd14e6b28
ap_single_module_configure(0x2001b0a8, 0x2001b0d0, 0x200612a0) at 0x10018f8c
load_module(0x2ff22620, 0x0, 0x2001c978, 0x2001c988) at 0x1006a974
invoke_cmd(0x20006d60, 0x2ff22620, 0x0, 0x2ff20600) at 0x10016738
ap_handle_command(0x2ff22620, 0x2001bc60, 0x2ff205d0) at 0x100175bc
ap_srm_command_loop(0x2ff22620, 0x2001bc60) at 0x100176ac
ap_process_resource_config(0x2001b0d0, 0x2001c7a8, 0x2001b0a8, 0x2001f0e8) at 0x10018140
ap_read_config(0x2001b0a8, 0x2001f0e8, 0x20002f1c) at 0x10018e10
http_main.main(0x2, 0x2ff22804) at 0x10006bd8
(dbx) quit

# gdb httpd
GNU gdb 4.18
Copyright 1998 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 "powerpc-ibm-aix4.3.2.0"...
(gdb) run -X
Starting program: /home/apache/bin/httpd -X
"/usr/lib/libpthreads.a": not in executable format: File format not recognized.
(gdb) c
Continuing.
"/usr/lpp/xlC/lib/libC.a": not in executable format: File format not recognized.
(gdb) c
Continuing.
"/usr/lib/libbind.a": not in executable format: File format not recognized.
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0xd14e5658 in ?? () from (unknown load module)
(gdb) bt
#0  0xd14e5658 in ?? () from (unknown load module)
#1  <signal handler called>
(gdb) quit


I think this is very similar to bug #4630.
What should I do?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-12 04:04 UTC] sniper@php.net
Please try the latest CVS snapshot from http://snaps.php.net/ as #4630 was reported to be fixed now.

 [2001-07-19 00:56 UTC] cmlee at bigfoot dot com
I tried to make php4-200107181935 snapshot.
But now I have another problem which is an installation failure.

$ ./configure --enable-debug \
--with-apxs=/home/apache/bin/apxs \
--with-mysql=no
...
$ make
...
$ su
$ make install
...
Making install in .
make[1]: Entering directory `/home/cmlee/php4-200107181935'
/home/cmlee/php4-200107181935/build/shtool mkdir -p "/home/apache/libexec" 
&& /home/apache/bin/apxs -S LIBEXECDIR="/home/apache/libexec" -i -a -n php4 
libs/libphp4.so
[activating module `php4' in /home/apache/conf/httpd.conf]
cp libs/libphp4.so /home/apache/libexec/libphp4.so
cp: libs/libphp4.so: No such file or directory
apxs:Break: Command failed with rc=1
make[1]: *** [install-sapi] Error 1
make[1]: Leaving directory `/home/cmlee/php4-200107181935'
make: *** [install-recursive] Error 1




 [2001-10-21 00:06 UTC] sniper@php.net
Would you please try again the latest snapshot?

 [2001-10-28 23:34 UTC] cmlee at users dot sourceforge dot net
I tried, however the result is same before.

Tried snapshot : php4-200110281500.tar.gz

$ pwd
/home/cmlee/php4-200110281500

$ ./configure --enable-debug \
--with-apxs=/usr/local/apache/bin/apxs \
--with-mysql=no

$ make
ar -crlo .libs/libphp4.a .libs/libphp4.so.0
rm -fr .libs/libphp4.lax
creating libphp4.la
(cd .libs && rm -f libphp4.la && ln -s ../libphp4.la libphp4.la)
make[1]: Leaving directory `/home/cmlee/php4-200110281500'
Making all in pear
make[1]: Entering directory `/home/cmlee/php4-200110281500/pear'
make[1]: Leaving directory `/home/cmlee/php4-200110281500/pear'

$ su
# make install

Making install in .
make[1]: Entering directory `/home/cmlee/php4-200110281500'
/home/cmlee/php4-200110281500/build/shtool mkdir -p "/usr/local/apache/libexec" && /usr/local/apache/bin/apxs -S LIBEXECDIR="/usr/local/apache/libexec" -i -a -n php4 libs/libphp4.so
[activating module `php4' in /usr/local/apache/conf/httpd.conf]
cp libs/libphp4.so /usr/local/apache/libexec/libphp4.so
cp: libs/libphp4.so: No such file or directory
apxs:Break: Command failed with rc=1
make[1]: *** [install-sapi] Error 1
make[1]: Leaving directory `/home/cmlee/php4-200110281500'
make: *** [install-recursive] Error 1

# cp .libs/libphp4.so.0 /usr/local/apache/libexec/libphp4.so

# cd /usr/local/apache/bin

# ./httpd -X
Segmentation fault (core dumped)

# gdb httpd
GNU gdb 4.18
Copyright 1998 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 "powerpc-ibm-aix4.3.2.0"...
(gdb) run -X
Starting program: /usr/locql/apache/bin/httpd -X
"/usr/lib/libpthreads.a": not in executable format: File format not recognized.
(gdb) c
Continuing.
"/usr/lpp/xlC/lib/libC.a": not in executable format: File format not recognized.
(gdb) c
Continuing.
"/usr/lib/libbind.a": not in executable format: File format not recognized.
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0xd0b5acac in ?? () from (unknown load module)
(gdb) bt
#0  0xd0b5acac in ?? () from (unknown load module)
#1  <signal handler called>
(gdb) quit


 [2002-01-12 14:44 UTC] lobbin@php.net
Can you try with the latest release 4.1.1?
 [2002-01-16 02:45 UTC] cmlee at users dot sourceforge dot net
This is my testing environment:
   AIX 4.3.3
   gcc 2.95.3
   Apache 1.3.22
   PHP 4.1.1

It works in DSO-enabled apache. However, there is still
installation problem like the following.

--- configure and make works fine ---

# make install

Making install in .
make[1]: Entering directory `/home/cmlee/php-4.1.1'
/usr/local/apache/bin/apxs -i -a -n php4 libs/libphp4.so
[activating module `php4' in [/usr/local/apache/conf/httpd.conf]
cp libs/libphp4.so /usr/local/apache/libexec/libphp4.so
cp: libs/libphp4.so: No such file or directory
apxs:Break: Command failed with rc=1
make[1]: *** [install-sapi] Error 1
make[1]: Leaving directory `/home/cmlee/php-4.1.1'
make: *** [install-recursive] Error 1

# cp .libs/libphp4.so.0 /usr/local/apache/libexec/libphp4.so

# cd /usr/local/apache/bin

# ./apachectl start
./apahectl start: httpd started

Now PHP on the DSO-enabled apache are working well.
I've tested with 'phpinfo()' function.

 [2002-01-16 02:51 UTC] lobbin@php.net
Can you provide some output from make/configure where .libs/libphp4.so.0 is referenced?
 [2002-01-16 05:12 UTC] cmlee at users dot sourceforge dot net
This is output from make.

############ SKIP ############

mkdir .libs
rm -fr .libs/libregex.la .libs/libregex.* .libs/libregex.*
ar cru .libs/libregex.al regcomp.lo regexec.lo regerror.lo regfree.lo
ranlib .libs/libregex.al
creating libregex.la
(cd .libs && rm -f libregex.la && ln -s ../libregex.la libregex.la)
make[2]: Leaving directory `/home/cmlee/Project/php-4.1.1/regex'
make[1]: Leaving directory `/home/cmlee/Project/php-4.1.1/regex'
Making all in .
make[1]: Entering directory `/home/cmlee/Project/php-4.1.1'
/bin/sh /home/cmlee/Project/php-4.1.1/libtool --mode=compile gcc  -I. -I/home/cmlee/Project/php-4.1.1/ -I/home/cmlee/Project/php-4.1.1/main -I/home/cmlee/Project/php-4.1.1 -I/usr/local/apache/include -I/home/cmlee/Project/php-4.1.1/Zend -I/home/cmlee/Project/php-4.1.1/ext/xml/expat  -DAIX=43 -DUSE_PTHREAD_SERIALIZED_ACCEPT -DAIX_BIND_PROCESSOR -DUSE_HSREGEX -DUSE_EXPAT -I/home/cmlee/Project/php-4.1.1/TSRM -O2 -g -Wall -prefer-pic  -c stub.c
gcc -I. -I/home/cmlee/Project/php-4.1.1/ -I/home/cmlee/Project/php-4.1.1/main -I/home/cmlee/Project/php-4.1.1 -I/usr/local/apache/include -I/home/cmlee/Project/php-4.1.1/Zend -I/home/cmlee/Project/php-4.1.1/ext/xml/expat -DAIX=43 -DUSE_PTHREAD_SERIALIZED_ACCEPT -DAIX_BIND_PROCESSOR -DUSE_HSREGEX -DUSE_EXPAT -I/home/cmlee/Project/php-4.1.1/TSRM -O2 -g -Wall -c stub.c  -DPIC -o stub.lo
/bin/sh /home/cmlee/Project/php-4.1.1/libtool --mode=link gcc  -I. -I/home/cmlee/Project/php-4.1.1/ -I/home/cmlee/Project/php-4.1.1/main -I/home/cmlee/Project/php-4.1.1 -I/usr/local/apache/include -I/home/cmlee/Project/php-4.1.1/Zend -I/home/cmlee/Project/php-4.1.1/ext/xml/expat  -DAIX=43 -DUSE_PTHREAD_SERIALIZED_ACCEPT -DAIX_BIND_PROCESSOR -DUSE_HSREGEX -DUSE_EXPAT -I/home/cmlee/Project/php-4.1.1/TSRM -O2 -g -Wall -prefer-pic   -o libphp4.la -rpath /home/cmlee/Project/php-4.1.1/libs -Wl,-bI:/usr/local/apache/libexec/httpd.exp -avoid-version   stub.lo  Zend/libZend.la sapi/apache/libsapi.la main/libmain.la regex/libregex.la ext/pcre/libpcre.la ext/posix/libposix.la ext/session/libsession.la ext/standard/libstandard.la ext/xml/libxml.la TSRM/libtsrm.la -ldl -lcrypt -lbind -lm -ldl -lcrypt
mkdir .libs
rm -fr .libs/libphp4.la .libs/libphp4.* .libs/libphp4.*
(cd . && ln -s stub.lo stub.o)
generating symbol list for `libphp4.la'
/usr/bin/nm -B  stub.o   Zend/.libs/libZend.al sapi/apache/.libs/libsapi.al main/.libs/libmain.al regex/.libs/libregex.al ext/pcre/.libs/libpcre.al ext/posix/.libs/libposix.al ext/session/.libs/libsession.al ext/standard/.libs/libstandard.al ext/xml/.libs/libxml.al TSRM/.libs/libtsrm.al | sed -n -e 's/^.*[     ]\([BCDT][BCDT]*\)[     ][      ]*\(\)\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2\3 \3/p' | sed 's/.* //' | sort | uniq > .libs/libphp4.exp
nm: ext/standard/.libs/libstandard.al[image.lo]: 0654-206 Cannot process the symbol table.

############ SKIP ############

(cd .libs/libphp4.lax/libtsrm.al && ar x /home/cmlee/Project/php-4.1.1/TSRM/.libs/libtsrm.al)
gcc -shared -o .libs/libphp4.so.0  stub.o  .libs/libphp4.lax/libZend.al/zend_language_parser.lo (..... SKIP .....) TSRM/.libs/libtsrm.al -ldl -lcrypt -lbind -lm -ldl -lcrypt           -lc  -Wl,-bI:/usr/local/apache/libexec/httpd.exp ${wl}-berok -Wl,-bnoentry -Wl,-bexport:.libs/libphp4.exp 
ar -crlo .libs/libphp4.a .libs/libphp4.so.0
rm -fr .libs/libphp4.lax
creating libphp4.la
(cd .libs && rm -f libphp4.la && ln -s ../libphp4.la libphp4.la)
make[1]: Leaving directory `/home/cmlee/Project/php-4.1.1'
Making all in pear
make[1]: Entering directory `/home/cmlee/Project/php-4.1.1/pear'
make[1]: Leaving directory `/home/cmlee/Project/php-4.1.1/pear'


 [2002-01-29 06:37 UTC] vervoom at hotmail dot com
I'm having exactly the same problem as this:

# ./apachectl start
./apachectl[71]: 13068 Segmentation fault(coredump)
./apachectl start: httpd could not be started

If I remove the LoadModule libexec/libphp4.so line from the conf, httpd starts OK. I've been looking at the previous reports on this bug, and your answer is always try the latest snapshot. Well considering this problem has been going on for over 2 years now, perhaps we could have a more original answer please?!

I've tried 4.0.6, and 4.1.1 and your latest snapshot!!
With php-4.1.1 I even had to tinker with your make install script to get it to install properly. If you can't even set this product up to work properly from the start, then that doesn't say very much for it!! Why don't your developers sort it out once and for all, and stop wasting everyone's time (including yours!!)?
 [2002-01-29 16:36 UTC] vervoom at hotmail dot com
Sorry about last comment, I was a bit stressed out earlier!
My environment is:

AIX 4.3.3.0
PHP 4.1.1
Apache 1.3.22
VAC.C 5.0.0.2 (IBM Visual Age C Compiler)

I think there's a definite problem with your make install script though with regards to extracting the libphp4.so to /apache/libexec. I got round that with ar -x libphp4.a and then running make install again.

Also there's something wrong when I dynamically load the library because it's causing a coredump. It's really frustrating. I remember having exactly the same problem on Solaris a few months ago, but I've forgotten what I did to fix it (even more frustrating!). I thought it was something to do with a linker PATH variable? Do I need to set some variable to point at /usr/local/include/php? Should I change something in the php.ini file?

I really don't want to change compilers at this stage because everything else is working fine with VAC. Does this have anything to do with the compiler fix mentioned in BUG 4630? I'll try that tomorrow.

OK Well that's all I can think of. My configure was pretty basic:

./configure --with-apxs=/opt/apache/bin/apxs --without-mysql

Are there some other options I should have added? 

Cheers,

JS.
 [2002-07-30 09:02 UTC] cmlee at users dot sourceforge dot net
Recently I tried the latest release(4.2.2), and It works
well if you manually copy libphp4.so.0 into Apache's libexec
directory:

 $ cp .libs/libphp4.so.0 SOMEWHERE/apache/libexec/libphp4.so

It means that 'make install-sapi' fails because there is
no libphp4.so[.0] when 'install-sapi' tries to copy.
To fix this problem, LIBTOOL must copy .libs/libphp4.so[.0]
files into libs/ directory.

I have a patch to resolve this problem at the following link:

  http://tclab.kaist.ac.kr/~cmlee/pub/php-4.2.2-20020730.patch

I've tested the patch in the following environment:

  - AIX 4.3.3
  - GNU gcc 2.95.3
  - Apache 1.3.26
  - PHP 4.2.2

Hope this help to close this problem and the patch come to
no harm to others. :)

--
CheolMin Lee
 [2002-08-17 01:57 UTC] kalowsky@php.net
Part of the reason we ask to try new versions is a developer may believe they have fixed the bug.  Not many of us have access to an AIX box for any testing.  The patch provided though for fixing this is a great help.  The biggiest problem with it is, it's been created for the configure script which is a generated file.   

If you can port it to the ltmain.sh and/or the acinclude.m4 (which ever requires the work) that would ensure its inclusion in the next release of PHP.  But right now I can only seem to make 1/2 of it work.  Message sent to PHP Dev asking for more help
 [2002-11-10 18:48 UTC] iliaa@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


 [2002-11-21 17:07 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2002-11-24 21:59 UTC] cmlee at users dot sourceforge dot net
I've tested using CVS snapshots.
But there is still a installation problem what I mentioned
on 30 July. I think it is a bug of libtool generated from
PHP configure script.

I know this is a different problem from 'segmentation fault', what I submitted first. So I'd like to close this
case.

--
CheolMin Lee
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC