php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3466 Apache segfaults/dumps core whenever PHP3 module enabled in config
Submitted: 2000-02-12 12:38 UTC Modified: 2000-08-06 09:53 UTC
From: turinsky at somesites dot com Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.14 OS: Linux 2.2.14/Mandrake 7.0
Private report: No CVE-ID: None
 [2000-02-12 12:38 UTC] turinsky at somesites dot com
System: Mandrake 7.0, Linux 2.2.14

Do RPM --rebuild MySQL-3.22.30-1.src.rpm and install resulting binary RPMS.  They appear to work fine.

Compile OpenSSL 0.9.4 (no RSAREF) with -fPIC and install
Make mod_perl 1.21 with USE_APACI=1 EVERYTHING=1 PERL_MARK_WHERE=1 and install
Make mod_ssl 2.5.0-1.3.11
Compile and install Apache 1.3.11 with
./configure --with-layout=RedHat --enable-module=all --enable-shared=max --enable-module=ssl --enable-shared=ssl --activate-module=src/modules/perl/libperl.a

[make, make certificate, make install all go okay]
Run apache, works fine.

Configure PHP 3.0.14: ./configure --with-apxs=/usr/sbin/apxs --with-config-file-path=/etc/httpd/conf/ --with-xml --with-gd --with-mysql

finds everything it wants.
make and make install work

Apache won't start (no ssl),  "LoadModule php3_module        lib/apache/libphp3.so " is in <IfDefine SSL> section.

Move that part out of <IfDefine SSL> and try to start Apache.

Apache segfaults, dumps core, complains about "Cannot access memory at address 0x(address).

Try several other things, Apache does the same thing with or without using SSL.  Comment out PHP module, Apache runs FINE.

run "gdb /usr/sbin/httpd ./core"
Core was generated with "httpd -X"
Program terminated with signal 11, Segmentation fault.
Reading symbols (etc.)
#0  0x4037f0f8 in ?? ()
(gdb) set args -X
(gdb) run
Starting program: /usr/sbin/httpd -X
Cannot access memory at address 0x402f84d4
(gdb) bt
#0  0x4000a611 in ?? () from /lib/ld-linux.so.2
#1  0x4000c038 in ?? () from /lib/ld-linux.so.2
#2  0x40001fc7 in ?? () from /lib/ld-linux.so.2
#3  0x40001f32 in ?? () from /lib/ld-linux.so.2

If I do it without -X:
(gdb) bt
#0  0x4037f0f8 in ?? ()
#1  0x40178313 in __getservbyname_r (name=0x4041aa36 "mysql",
    proto=0x4041acd0 "tcp", resbuf=0x401a4f5c, buffer=0x817d330 "mysql",
    buflen=1024, result=0xbfffd6d8) at ../nss/getXXbyYY_r.c:182
#2  0x401781c5 in getservbyname (name=0x4041aa36 "mysql",
    proto=0x4041acd0 "tcp") at ../nss/getXXbyYY.c:137
#3  0x403e1e5a in php3_minit_mysql (type=1, module_number=9)
    at functions/mysql.c:258
#4  0x403c2d2a in module_startup_modules () at internal_functions.c:533
#5  0x403bb9a7 in php3_module_startup () at main.c:1237
#6  0x403b92e0 in php3_create_dir () from /usr/lib/apache/libphp3.so
#7  0x80816fc in ap_single_module_configure ()
#8  0x8062014 in load_module ()
#9  0x807fdce in invoke_cmd ()
#10 0x8080791 in ap_handle_command ()
#11 0x808082f in ap_srm_command_loop ()
#12 0x8080c84 in ap_process_resource_config ()
#13 0x808160c in ap_read_config ()
#14 0x808b6f0 in standalone_main ()
#15 0x808c03c in main ()
#16 0x400d99ee in __libc_start_main (main=0x808bc84 <main>, argc=2,  argv=0xbffffa84, init=0x8060cd4 <_init>, fini=0x812c8b4 <_fini>,
    rtld_fini=0x4000a570 <_dl_fini>, stack_end=0xbffffa7c)
    at ../sysdeps/generic/libc-start.c:90 

Anyone know what's going on here?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-02-17 20:36 UTC] turinsky at somesites dot com
Same problems on a fresh Mandrake 7.0 install
No SSL

[mod_perl]
perl Makefile.pl APACHE_SRC=../apache_1.3.11/src USE_APACI=1 EVERYTHING=1 PERL_MARK_WHERE=1 PERL_SSI=1
make
make install

[apache]
./configure --with-layout=RedHat --activate-module=src/modules/perl/libperl.a --enable-module=all -enable-shared=all -disable-shared=perl
make
make install

(of course NO PROBLEMS here, none compiling, none running Apache)

[php 3.0.14]
./configure --with-apxs=/usr/sbin/apxs --with-config-file-path=/etc/httpd/conf --with-gd --with-xml --with-mysql

MySQL 3.22.32 installed from source RPM compiled on the same system.

run /usr/sbin/httpd -X or attempt to start Apache with apachectl:
Segmentation fault (core dumped)
 
# gdb /usr/sbin/httpd ./core
(reads symbols)
#0  0x4038b0f8 in ?? ()
(gdb) set args -X
(gdb) run
Starting program: /usr/sbin/httpd -X
Cannot access memory at address 0x403044d4  


ANYONE HAVE ANY IDEA WHAT'S GOING ON?  (starts pulling hair and stuff out!)

 [2000-02-17 21:02 UTC] turinsky at somesites dot com
Just Apache 1.3.11 and PHP 3.0.14:
(no I don't use NIS/YP)
Pretty much the same compile options...

#0  0x4038d246 in nis_getservlist (dir=0x80d0160 "p\001\r\b??\030@?#\016\bI")
    at nis_getservlist.c:70
70      nis_getservlist.c: No such file or directory.
(gdb) bt
#0  0x4038d246 in nis_getservlist (dir=0x80d0160 "p\001\r\b??\030@?#\016\bI")
    at nis_getservlist.c:70
#1  0x4016b70f in pmap_getport (address=0xbfffd5bc, program=100007, version=2,
    protocol=6) at pm_getport.c:88
#2  0x40169b09 in clnttcp_create (raddr=0xbfffd5bc, prog=100007, vers=2,
    sockp=0xbfffd598, sendsz=0, recvsz=0) at clnt_tcp.c:145
#3  0x40384a2f in __yp_bind (domain=0x40393a40 "Jewel.SomeSites.com",
    ypdb=0xbfffd608) at ypclnt.c:149
#4  0x40384d60 in do_ypcall (domain=0x40393a40 "Jewel.SomeSites.com", prog=3,
    xargs=0x4038424c <xdr_ypreq_key>, req=0xbfffd65c "@:9@\020\004<@\006",
    xres=0x40384310 <xdr_ypresp_val>, resp=0xbfffd650 "") at ypclnt.c:267
#5  0x40385112 in yp_match (indomain=0x40393a40 "Jewel.SomeSites.com",
    inmap=0x403c0410 "passwd.byname", inkey=0x80c3454 "nobody", inkeylen=6,
    outval=0xbfffd6e0, outvallen=0xbfffd6e4) at ypclnt.c:430
#6  0x403bd2d9 in _nss_nis_getpwnam_r (name=0x80c3454 "nobody",
    pwd=0x4018e0a0, buffer=0x80d6be8 "nobody", buflen=1024, errnop=0x4018cc40)
    at nss_nis/nis-pwd.c:231
#7  0x4012b9bf in __getpwnam_r (name=0x80c3454 "nobody", resbuf=0x4018e0a0,
    buffer=0x80d6be8 "nobody", buflen=1024, result=0xbfffd788)
    at ../nss/getXXbyYY_r.c:182
#8  0x4012b211 in getpwnam (name=0x80c3454 "nobody") at ../nss/getXXbyYY.c:137
#9  0x806d204 in ap_uname2id ()
#10 0x8059c48 in set_user ()
#11 0x8054e7d in invoke_cmd ()
#12 0x80558a1 in ap_handle_command ()
#13 0x805593d in ap_srm_command_loop ()
#14 0x8055d94 in ap_process_resource_config ()
#15 0x80566fc in ap_read_config ()
#16 0x80604d0 in standalone_main ()
#17 0x8060dfc in main ()
#18 0x400c39ee in __libc_start_main (main=0x8060a64 <main>, argc=2,
    argv=0xbffffa74, init=0x804e828 <_init>, fini=0x8096134 <_fini>,
    rtld_fini=0x4000a570 <_dl_fini>, stack_end=0xbffffa6c)
    at ../sysdeps/generic/libc-start.c:90       
 [2000-02-17 22:31 UTC] turinsky at somesites dot com
I've also tried this with the binary rpms from the MySQL people, same result.
#0  0x4038a0f8 in ?? ()
#1  0x40179313 in __getservbyname_r (name=0x40426a36 "mysql",
    proto=0x40426cd0 "tcp", resbuf=0x401a5f5c, buffer=0x817e190 "mysql",
    buflen=1024, result=0xbfffd6e8) at ../nss/getXXbyYY_r.c:182
#2  0x401791c5 in getservbyname (name=0x40426a36 "mysql",
    proto=0x40426cd0 "tcp") at ../nss/getXXbyYY.c:137
#3  0x403ede5a in php3_minit_mysql (type=1, module_number=9)
    at functions/mysql.c:258
#4  0x403ced2a in module_startup_modules () at internal_functions.c:533
#5  0x403c79a7 in php3_module_startup () at main.c:1237
#6  0x403c52e0 in php3_create_dir () from /usr/lib/apache/libphp3.so
#7  0x8080b5c in ap_single_module_configure ()
#8  0x8061686 in load_module ()
#9  0x807f2ae in invoke_cmd ()
#10 0x807fc11 in ap_handle_command ()
#11 0x807fcad in ap_srm_command_loop ()
#12 0x8080104 in ap_process_resource_config ()
#13 0x8080a6c in ap_read_config ()
#14 0x808a840 in standalone_main ()
#15 0x808b16c in main ()
#16 0x400da9ee in __libc_start_main (main=0x808add4 <main>, argc=2,  argv=0xbffffa84, init=0x8060394 <_init>, fini=0x8129754 <_fini>,
    rtld_fini=0x4000a570 <_dl_fini>, stack_end=0xbffffa7c)
    at ../sysdeps/generic/libc-start.c:90

Please, if anyone can tell me if it's possibly a certain library or something, let me know and I will rip apart my system if I have to in order to get it working!!

 [2000-08-06 09:53 UTC] rasmus@php.net
Make sure your mysql client library is not linked against pthreads.  Check using: ldd libmysqlclient.so
Try a current snapshot from snaps.php.net and let us know if you are still seeing these problems.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 20:01:32 2024 UTC