php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19473 httpd segfaults
Submitted: 2002-09-18 05:40 UTC Modified: 2002-09-19 05:26 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: paul at myitcv dot org dot uk Assigned:
Status: Not a bug Package: Apache related
PHP Version: 4.2.3 OS: Linux 2.4.17 SMP (SuSE 7.2)
Private report: No CVE-ID: None
 [2002-09-18 05:40 UTC] paul at myitcv dot org dot uk
Dear PHP,

I have just encountered the following problem when attempting to build a large RPM of apache, mod_ssl, mod_auth_kerb and mod_php. The final product will be a static build of apache with the modules listed.

Within the spec file I am configure php in the following manner:

./configure \
 --prefix=%{_usr} \
 --bindir=%{_bindir} \
 --libdir=%{_libdir} \
 --with-config-file-path=%{sysconfdir} \
 --with-apache=../%{name_apache} \
 --disable-rpath \
 --with-pgsql=/usr \
 --with-xml \
 --enable-debug \
 --enable-safe-mode \
 --enable-memory-limit \
 --with-kerberos \
 --with-imap \
 --with-imap-ssl \
 --enable-versioning \
 --with-gd \
 --with-jpeg-dir=/usr \
 --enable-xslt --with-xslt-sablot \
 --enable-sysvshm --enable-sysvsem --with-regex=php \
 --with-sockets \
 --with-png-dir=/usr \
 --with-zlib-dir=/usr \
 --without-mysql \
 --with-xpm-dir=/usr/X11R6 \
 --with-curl


** NOTE: I removed --with-openssl in accordance with the solution sniper@php.net provided for a similar looking bug with ENOTTY.



Apache configuration:


env \
 'LIBS=-L/usr/kerberos/lib -lkrb5 -lk5crypto -lcom_err' \
 'INCLUDES=-I/usr/include/openssl -I/usr/kerberos/include' \
 'SSL_BASE=SYSTEM' \
 'LDFLAGS=-L/usr/X11R6/lib' \
 '-DKRB5 -DKRB_DEF_REALM=\\\"DOC.IC.AC.UK\\\" -DSSL_EXPERIMENTAL_PERDIRCA_IGNORE' \
./configure \
 --prefix=%{datadir} \
 --bindir=%{_bindir} \
 --sbindir=%{_sbindir} \
 --datadir=%{datadir} \
 --sysconfdir=%{sysconfdir} \
 --mandir=%{_mandir} \
 --logfiledir=%{logdir} \
 --localstatedir=%{_var} \
 --runtimedir=%{_var}/run \
 --libexecdir=%{_libdir}/%{name} \
 --proxycachedir=%{_var}/cache/http \
 --includedir=%{includedir} \
 --verbose \
 --enable-module=info \
 --enable-module=rewrite \
 --enable-module=digest \
 --enable-module=proxy \
 --enable-module=auth_dbm \
 --enable-module=ssl \
 --enable-rule=SSL_SDBM \
 --enable-rule=SSL_EXPERIMENTAL \
 --add-module=src/modules/kerberos/mod_auth_kerb.c \
 --with-perl=`which perl` \
 --server-uid=%{apache_user} \
 --server-gid=%{apache_group} \
 --enable-suexec \
 --suexec-logfile=/export/logs/suexec_log \
 --activate-module=src/modules/php4/libphp4.a


strace on the httpd binary gives:


open("./php.ini", O_RDONLY)             = -1 ENOENT (No such file or directory)
open("/etc/httpd/php.ini", O_RDONLY)    = 3
getcwd("/usr/sbin", 4095)               = 10
lstat64("/etc", {st_mode=S_IFDIR|0755, st_size=5566, ...}) = 0
lstat64("/etc/httpd", {st_mode=S_IFDIR|0755, st_size=205, ...}) = 0
lstat64("/etc/httpd/php.ini", {st_mode=S_IFREG|0400, st_size=2907, ...}) = 0
brk(0x8346000)                          = 0x8346000
ioctl(3, TCGETS, 0xbffff2ac)            = -1 ENOTTY (Inappropriate ioctl for dev
ice)
fstat64(3, {st_mode=S_IFREG|0400, st_size=2907, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0
x40018000
read(3, ";*******************************"..., 8192) = 2907
read(3, "", 4096)                       = 0
brk(0x8347000)                          = 0x8347000
read(3, "", 8192)                       = 0
ioctl(3, TCGETS, 0xbfffe708)            = -1 ENOTTY (Inappropriate ioctl for dev
ice)
close(3)                                = 0
munmap(0x40018000, 4096)                = 0
brk(0x8348000)                          = 0x8348000
brk(0x8349000)                          = 0x8349000
brk(0x834a000)                          = 0x834a000
brk(0x834b000)                          = 0x834b000
brk(0x834c000)                          = 0x834c000
brk(0x834d000)                          = 0x834d000
brk(0x834e000)                          = 0x834e000
brk(0x834f000)                          = 0x834f000
brk(0x8350000)                          = 0x8350000
brk(0x8351000)                          = 0x8351000
brk(0x8352000)                          = 0x8352000
brk(0x8353000)                          = 0x8353000
brk(0x8354000)                          = 0x8354000
brk(0x8355000)                          = 0x8355000
brk(0x8356000)                          = 0x8356000
brk(0x8357000)                          = 0x8357000
brk(0x8358000)                          = 0x8358000
brk(0x8359000)                          = 0x8359000
brk(0x835a000)                          = 0x835a000
brk(0x835b000)                          = 0x835b000
brk(0x835c000)                          = 0x835c000
brk(0x835d000)                          = 0x835d000
brk(0x835e000)                          = 0x835e000
brk(0x8360000)                          = 0x8360000
brk(0x8361000)                          = 0x8361000
brk(0x8362000)                          = 0x8362000
brk(0x8363000)                          = 0x8363000
stat64("/etc/cram-md5.pwd", 0xbffff27c) = -1 ENOENT (No such file or directory)
stat64("/dev/urandom", {st_mode=S_IFCHR|0644, st_rdev=makedev(1, 9), ...}) = 0
brk(0x8364000)                          = 0x8364000
brk(0x8365000)                          = 0x8365000
brk(0x8366000)                          = 0x8366000
brk(0x8367000)                          = 0x8367000
brk(0x8368000)                          = 0x8368000
brk(0x8369000)                          = 0x8369000
brk(0x836a000)                          = 0x836a000
brk(0x836b000)                          = 0x836b000
brk(0x836c000)                          = 0x836c000
brk(0x836d000)                          = 0x836d000
brk(0x836e000)                          = 0x836e000
brk(0x836f000)                          = 0x836f000
brk(0x8370000)                          = 0x8370000
brk(0x8371000)                          = 0x8371000
brk(0x8372000)                          = 0x8372000
brk(0x8373000)                          = 0x8373000
brk(0x8375000)                          = 0x8375000
brk(0x8376000)                          = 0x8376000
brk(0x8377000)                          = 0x8377000
getpid()                                = 21310
brk(0x8378000)                          = 0x8378000



gdb backtrace as follows:

bash-2.05# gdb /usr/sbin/httpd /usr/sbin/core 
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 "i386-suse-linux"...(no debugging symbols found)...
Core was generated by `./httpd start'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/kerberos/lib/libkrb5.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/kerberos/lib/libkrb5.so.3
Reading symbols from /usr/kerberos/lib/libk5crypto.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/kerberos/lib/libk5crypto.so.3
Reading symbols from /lib/libcom_err.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/libcom_err.so.2
Reading symbols from /lib/libpam.so.0...(no debugging symbols found)...done.
Loaded symbols for /lib/libpam.so.0
Reading symbols from /usr/lib/libcrypto.so.0.9.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libcrypto.so.0.9.6
Reading symbols from /usr/lib/libssl.so.0.9.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libssl.so.0.9.6
Reading symbols from /usr/lib/libsablot.so.0...done.
Loaded symbols for /usr/lib/libsablot.so.0
Reading symbols from /usr/lib/libexpat.so.0...done.
Loaded symbols for /usr/lib/libexpat.so.0
Reading symbols from /usr/lib/libpq.so.2...done.
Loaded symbols for /usr/lib/libpq.so.2
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /usr/lib/libgd.so.4...done.
Loaded symbols for /usr/lib/libgd.so.4
Reading symbols from /usr/X11R6/lib/libX11.so.6...done.
Loaded symbols for /usr/X11R6/lib/libX11.so.6
Reading symbols from /usr/X11R6/lib/libXpm.so.4...done.
Loaded symbols for /usr/X11R6/lib/libXpm.so.4
Reading symbols from /usr/lib/libpng.so.2...done.
Loaded symbols for /usr/lib/libpng.so.2
Reading symbols from /lib/libz.so.1...done.
Loaded symbols for /lib/libz.so.1
Reading symbols from /usr/lib/libjpeg.so.62...done.
Loaded symbols for /usr/lib/libjpeg.so.62
Reading symbols from /usr/lib/libcurl.so.2...done.
Loaded symbols for /usr/lib/libcurl.so.2
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /usr/kerberos/lib/libgssapi_krb5.so.2...done.
Loaded symbols for /usr/kerberos/lib/libgssapi_krb5.so.2
Reading symbols from /usr/lib/libgdbm.so.2...done.
Loaded symbols for /usr/lib/libgdbm.so.2
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /usr/kerberos/lib/libcom_err.so.3...done.
Loaded symbols for /usr/kerberos/lib/libcom_err.so.3
Reading symbols from /usr/lib/libfreetype.so.6...done.
Loaded symbols for /usr/lib/libfreetype.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0  0x81b9fb4 in ssl_ext_unregister ()
(gdb) bt 
#0  0x81b9fb4 in ssl_ext_unregister ()
#1  0x81f26b4 in ap_hook_call ()
#2  0x81f146c in ap_hook_use ()
#3  0x819e175 in php_mergesort ()
#4  0x81cf2d4 in ap_init_modules ()
#5  0x81dafc3 in main ()
#6  0x40473c6f in __libc_start_main () from /lib/libc.so.6


Any clues as to what might be wrong???

For reference, the fs is reiserfs, with a couple of mount points using ext3.

Many thanks,


Paul J

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-18 18:59 UTC] sniper@php.net
It's obviously some clash with SSL. Are you sure you have linked every library which you're compiling PHP with, with the SAME ssl libs? For example Curl?

You should try configuring PHP first with minimal amount of
configure options and then try and add them one by one to see which one causes this.

--Jani


 [2002-09-19 05:26 UTC] paul at myitcv dot org dot uk
Sure!!

Rather embarrassingly it was an error in my httpd.conf file. Basically, we used to dynamically load php, mod_perl and all the apache modules via httpd.conf. When building this new statically compiled server, I simply copied across the old httpd.conf without thinking to remove the LoadModule and AddModule lines. It turns out the presence of the addmodule lines was sufficient to cause apache to segfault just around the time strace reported it to be loading the php.ini file. Hence the confusion :-) 

Cheers,


Paul
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 29 07:01:31 2024 UTC