Date: 11/30/99
- Next message: Thies C. Arntzen: "[PHP-DEV] Re: [PHP3] Count the number of rows with Oracle OCI8"
- Previous message: Manuel Lemos: "[PHP-DEV] Count the number of rows with Oracle OCI8"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: johan <email protected>
Operating system: Linux 2.2.12/2.2.13 (Slackware 4.0)
PHP version: 4.0 Beta 3
PHP Bug Type: Other
Bug description: Apache dumps core and dies, segfault at mod_php4.c:168
Apache repeatedly dumps core and totally dies (root-thread first, children timeout slowly), coredump revealing a segfault in mod_php4.c. Bug seems exist in both 4.0b2 & 4.0b3. However, using gdb to analyze coredump from 4.0b3 doesn't reveal the same amount of details, I don't know why. Here's an example from 4.0b2:
# php4.0b2
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 "i686-pc-linux-gnulibc1"...
Core was generated by `/usr/local/apache/bin/httpd -DSSL'.
Program terminated with signal 11, Segmentation fault.
Cannot access memory at address 0x40007138.
#0 0x80cb71e in sapi_apache_send_headers (sapi_headers=Cannot access memory at address 0xbffff3c0.
) at mod_php4.c:168
168 ((request_rec *) SG(server_context))->status = SG(sapi_headers).http_response_code;
(gdb) bt
#0 0x80cb71e in sapi_apache_send_headers (sapi_headers=Cannot access memory at address 0xbffff3c0.
) at mod_php4.c:168
Cannot access memory at address 0xbffff3b8.
(gdb) l
163 }
164
165
166 int sapi_apache_send_headers(sapi_headers_struct *sapi_headers SLS_DC)
167 {
168 ((request_rec *) SG(server_context))->status = SG(sapi_headers).http_response_code;
169 send_http_header((request_rec *) SG(server_context));
170 return SAPI_HEADER_SENT_SUCCESSFULLY;
171 }
172
(gdb)
# Doing the same thing on a coredump from 4.0b3 gives:
# php4.0b3
Core was generated by `/usr/local/apache/bin/httpd -DSSL'.
Program terminated with signal 11, Segmentation fault.
Cannot access memory at address 0x40007138.
#0 0x0 in ?? ()Cannot access memory at address 0x40007138.
(gdb) bt
#0 0x0 in ?? ()Cannot access memory at address 0x40007138.
(gdb)
I run the same setup on three different servers, all with approx 1000-1100 VHosts. It appears that when Apache is restarted (either gracefully or via full stop/start), it becomes more instable and crashes more often.
Here is my conf/build recipe for the "debuggable" binary:
######### CONFIG/BUILD #########
# Everything unzipped under /usr/src
# mod_throttle-2.07 included in apache-tree,
# patched to allow 3000 VHosts/throttles
# (MAX_THROTTLES set to 3000)
# HARD_SERVER_LIMIT raised to 1024 in
# apache/src/include/httpd.h
cd openssl-0.9.4
./config linux-elf:'/usr/bin/gcc -g -ggdb3'
make
make test
make install
cd ../mod_ssl-2.4.9-1.3.9
./configure \
--with-apache=../apache_1.3.9 \
--with-ssl=../openssl-0.9.4
cd ../apache_1.3.9
./configure \
--prefix=/usr/local/apache
cd ../php-4.0b3 # or beta 2
CFLAGS='-g -ggdb3 -I../openssl-0.9.4/include' \
./configure \
--with-apache=../apache_1.3.9 \
--with-mysql=/usr/local/ \
--with-gd=/usr/lib \
--enable-track-vars
make
make install
cd ../mod_perl-1.21
perl Makefile.PL \
APACHE_SRC=../apache_1.3.9/src \
DO_HTTPD=1 \
USE_APACI=1 \
PREP_HTTPD=1 \
EVERYTHING=1
make
make install
cd ../apache_1.3.9
SSL_BASE=../openssl-0.9.4 \
OPTIM="-g -ggdb3" \
./configure \
--prefix=/usr/local/apache \
--enable-module=ssl \
--activate-module=src/modules/php4/libphp4.a \
--enable-module=php4 \
--activate-module=src/modules/throttle/mod_throttle.o \
--activate-module=src/modules/perl/libperl.a \
--enable-module=perl \
--enable-suexec \
--suexec-caller=nobody \
--suexec-uidmin=500 \
--suexec-gidmin=100 \
--suexec-userdir=/home
make
# no "make install" - keep debugging-symbols (no strip):
cp /usr/src/apache_1.3.9/src/httpd /usr/local/apache/bin/httpd
# (The resulting binary is of course very large ~ 8.3 Mb)
# php.ini is kept as distributed except:
max_execution_time = 20
mysql.allow_persistent = Off
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Thies C. Arntzen: "[PHP-DEV] Re: [PHP3] Count the number of rows with Oracle OCI8"
- Previous message: Manuel Lemos: "[PHP-DEV] Count the number of rows with Oracle OCI8"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

