Apache processes seg fault with a bunch of 'child pid 5378 exit signal Segmentation fault (11)'.
How can I find out why the loaded module 'libphp5.so' causes a segfault when the standalone php binary works?
I am trying to use cross-compiled versions for powerpc of apache2.2.4 with php5.2.6 on an embedded linux board.
After cross-compiling php5.2.6, 'php -i' crashes with a 'Balloc() allocation exceeds list boundary', this seems to be a byte ordering issue, I fixed this by setting 'export ac_cv_c_bigendian_php=yes' before calling configure, see below.
I can now call the standalone php binary 'sapi/cli/php -f <file.php>' but when I use 'LoadModule php5_module modules/libphp5.so' in httpd.conf,
*any* request (.html, *.php) causes a bunch of 'child pid 5378 exit signal Segmentation fault (11)'.
I cannot manage to produce a core dump, 'ulimit unlimited' and 'CoreDumpDirectory ./coredump' in httpd.conf produces a zero-size file './coredump/core'.
This is an embedded system, so there is no gdb etc. on it.
How can I find out why the loaded module causes a segfault when the standalone php binary works?
Any help is appreciated!
httpd.conf:
ServerName <removed ip>
ServerRoot "./"
DocumentRoot "./www/"
LogLevel debug
LoadModule mime_module modules/mod_mime.so
LoadModule php5_module modules/libphp5.so
Listen <removed ip>:8080
User nobody
PHP cross-compile settings:
export PATH=/usr/local/ELDK-4.2/usr/ppc-linux/bin:/usr/local/ELDK-4.2/usr/bin:/usr/local/ELDK-4.2/bin:/usr/local/ELDK-4.2/sbin:$PATH
export CROSS_COMPILE=ppc_85xxDP-
export ac_cv_c_bigendian_php=yes
./configure --build=i386-linux --host=ppc-linux \
--with-apxs2=/home/christoph/apache-x86/bin/apxs \
--with-config-file-path=/home/christoph/apache-ppc/php \
--disable-all \
--prefix=/home/christoph/apache-ppc
PHP version:
# php -v
PHP 5.2.6 (cli) (built: Nov 14 2008 09:33:02)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
apache error log 'logs/error_log':
[Fri Nov 14 09:26:46 2008] [debug] mod_so.c(246): loaded module mime_module
[Fri Nov 14 09:26:46 2008] [debug] mod_so.c(246): loaded module php5_module
[Fri Nov 14 09:26:47 2008] [notice] Apache/2.2.4 (Unix) PHP/5.2.6 configured -- resuming normal operations
[Fri Nov 14 09:26:47 2008] [info] Server built: Apr 2 2008 16:30:30
[Fri Nov 14 09:26:47 2008] [debug] prefork.c(991): AcceptMutex: sysvsem (default: sysvsem)
< now I request a 'http://ip:8080/test.html' >
[Fri Nov 14 09:28:25 2008] [notice] child pid 5378 exit signal Segmentation fault (11)
[Fri Nov 14 09:28:25 2008] [notice] child pid 5379 exit signal Segmentation fault (11)
[Fri Nov 14 09:28:25 2008] [notice] child pid 5380 exit signal Segmentation fault (11)
[Fri Nov 14 09:28:28 2008] [notice] child pid 5381 exit signal Segmentation fault (11)
apache version:
# httpd -V
Server version: Apache/2.2.4 (Unix)
Server built: Apr 2 2008 16:30:30
Server's Module Magic Number: 20051115:4
Server loaded: APR 1.2.8, APR-Util 1.2.8
Compiled using: APR 1.2.8, APR-Util 1.2.8
Architecture: 32-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"