php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32783 php -v segfaults
Submitted: 2005-04-20 23:10 UTC Modified: 2005-04-21 22:49 UTC
From: johnw at netnation dot com Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4.3.11 OS: RedHat 7.3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: johnw at netnation dot com
New email:
PHP Version: OS:

 

 [2005-04-20 23:10 UTC] johnw at netnation dot com
Description:
------------
I have php compiled as an RPM.  Using the same src rpm for 4.3.10, but updating to 4.3.11, I am unable to build the updated RPM.  The configure flags are the same.

The reason for this is that when it tries to perform 
install-pear-installer, the newly compiled php binary segfaults.  Even performing a -v on the 4.3.11 php binary results in a segfault.

The configure flags:

configure \
        --disable-static \
        --disable-debug \
        --enable-pic \
        --enable-inline-optimization \
        --prefix=/usr \
        --sysconfdir=/etc \
        --with-config-file-path=/w/conf \
        --with-pear \
        --enable-magic-quotes \
        --enable-debugger \
        --enable-track-vars \
        --enable-safe-mode \
        --enable-memory-limit \
        --enable-dbx \
        --with-mod_charset \
        --with-exec-dir=/usr/bin \
        --with-regex=system \
        --with-versioning \
        --with-db \
        --with-ndb \
        --with-db2 \
        --with-gdbm \
        --with-mysql=/usr \
        --with-gd \
        --with-jpeg-dir \
        --with-png-dir \
        --with-xpm-dir \
        --with-freetype-dir=/usr \
        --enable-gd-native-ttf \
        --with-cybercash=/usr/local/cybercash/c-api \
        --without-mm \
        --with-openssl \
        --with-imap \
        --with-imap-ssl \
        --with-kerberos \
        --with-dbase \
        --with-filepro \
        --with-gettext \
        --with-mcrypt \
        --with-zlib-dir \
        --with-zlib \
        --with-curl \
        --enable-sysvsem \
        --enable-sysvshm \
        --enable-force-cgi-redirect \
        --enable-trans-sid \
        --enable-ftp \
        --with-xml \
        --enable-xslt \
        --with-xslt-sablot \
        --with-sablot-js \
        --with-pfpro=/usr/local/lib \
        --with-dom \
        --with-dom-xslt \
        --with-dom-exslt \
        --with-pspell \
        --with-mhash \
        --with-mssql



Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

+ popd
/usr/src/redhat/BUILD/php-4.3.11
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.38163
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd php-4.3.11
+ '[' /var/tmp/php-root '!=' / ']'
+ rm -rf /var/tmp/php-root
+ pushd build-cgi
/usr/src/redhat/BUILD/php-4.3.11/build-cgi /usr/src/redhat/BUILD/php-4.3.11
+ make install INSTALL_ROOT=/var/tmp/php-root
Installing PHP SAPI module:       cgi
Installing PHP CGI into: /var/tmp/php-root/usr/bin/
Installing PEAR environment:      /var/tmp/php-root/usr/lib/php/
make[1]: *** [install-pear-installer] Segmentation fault (core dumped)
make: *** [install-pear] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.38163 (%install)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.38163 (%install)


A strace of php -v is below:

stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
open("/etc/krb5.keytab", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
stat64("/dev/urandom", {st_mode=S_IFCHR|0644, st_rdev=makedev(1, 9), ...}) = 0
brk(0x8317000)                          = 0x8317000
brk(0x8318000)                          = 0x8318000
brk(0x8319000)                          = 0x8319000
brk(0x831a000)                          = 0x831a000
brk(0x831b000)                          = 0x831b000
brk(0x831c000)                          = 0x831c000
brk(0x831d000)                          = 0x831d000
brk(0x831e000)                          = 0x831e000
brk(0x831f000)                          = 0x831f000
brk(0x8320000)                          = 0x8320000
brk(0x8321000)                          = 0x8321000
brk(0x8322000)                          = 0x8322000
brk(0x8323000)                          = 0x8323000
brk(0x8324000)                          = 0x8324000
brk(0x8325000)                          = 0x8325000
brk(0x8326000)                          = 0x8326000
brk(0x8327000)                          = 0x8327000
brk(0x8328000)                          = 0x8328000
brk(0x8329000)                          = 0x8329000
brk(0x832a000)                          = 0x832a000
brk(0x832b000)                          = 0x832b000
brk(0x832c000)                          = 0x832c000
brk(0x832d000)                          = 0x832d000
brk(0x832e000)                          = 0x832e000
brk(0x832f000)                          = 0x832f000
brk(0x8330000)                          = 0x8330000
brk(0x8331000)                          = 0x8331000
brk(0x8332000)                          = 0x8332000
brk(0x8333000)                          = 0x8333000
brk(0x8334000)                          = 0x8334000
brk(0x8335000)                          = 0x8335000
brk(0x8336000)                          = 0x8336000
brk(0x8337000)                          = 0x8337000
brk(0x8338000)                          = 0x8338000
brk(0x8339000)                          = 0x8339000
brk(0x833a000)                          = 0x833a000
brk(0x833b000)                          = 0x833b000
brk(0x833e000)                          = 0x833e000
brk(0x833f000)                          = 0x833f000
brk(0x8340000)                          = 0x8340000
brk(0x8341000)                          = 0x8341000
brk(0x8342000)                          = 0x8342000
brk(0x8343000)                          = 0x8343000
brk(0x8344000)                          = 0x8344000
brk(0x8345000)                          = 0x8345000
brk(0x8346000)                          = 0x8346000
brk(0x8347000)                          = 0x8347000
brk(0x8348000)                          = 0x8348000
brk(0x8349000)                          = 0x8349000
brk(0x834b000)                          = 0x834b000
brk(0x834c000)                          = 0x834c000
brk(0x834d000)                          = 0x834d000
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++


Strace of the php 4.3.10 binary that doesn't segfault:

stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
stat64("/etc/krb5.conf", {st_mode=S_IFREG|0644, st_size=640, ...}) = 0
open("/etc/krb5.keytab", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
stat64("/dev/urandom", {st_mode=S_IFCHR|0644, st_rdev=makedev(1, 9), ...}) = 0
open("/usr/share/ssl/openssl.cnf", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=7317, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40014000
read(3, "#\n# OpenSSL example configuratio"..., 4096) = 4096
brk(0x8315000)                          = 0x8315000
read(3, "d Wide Web Pty Ltd\n\norganization"..., 4096) = 3221
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x40014000, 4096)                = 0
brk(0x8316000)                          = 0x8316000
brk(0x8317000)                          = 0x8317000
brk(0x8318000)                          = 0x8318000
brk(0x8319000)                          = 0x8319000
brk(0x831a000)                          = 0x831a000
brk(0x831b000)                          = 0x831b000
brk(0x831c000)                          = 0x831c000
brk(0x831d000)                          = 0x831d000
brk(0x831e000)                          = 0x831e000
brk(0x831f000)                          = 0x831f000
brk(0x8320000)                          = 0x8320000
brk(0x8321000)                          = 0x8321000
brk(0x8322000)                          = 0x8322000
brk(0x8323000)                          = 0x8323000
brk(0x8324000)                          = 0x8324000
brk(0x8325000)                          = 0x8325000
brk(0x8326000)                          = 0x8326000
brk(0x8327000)                          = 0x8327000
brk(0x8328000)                          = 0x8328000
brk(0x8329000)                          = 0x8329000
brk(0x832a000)                          = 0x832a000
brk(0x832b000)                          = 0x832b000
brk(0x832c000)                          = 0x832c000
brk(0x832d000)                          = 0x832d000
brk(0x832e000)                          = 0x832e000
brk(0x832f000)                          = 0x832f000
brk(0x8330000)                          = 0x8330000
brk(0x8331000)                          = 0x8331000
brk(0x8332000)                          = 0x8332000
brk(0x8333000)                          = 0x8333000
brk(0x8334000)                          = 0x8334000
brk(0x8335000)                          = 0x8335000
brk(0x8336000)                          = 0x8336000
brk(0x8337000)                          = 0x8337000
brk(0x8338000)                          = 0x8338000
brk(0x8339000)                          = 0x8339000
brk(0x833a000)                          = 0x833a000
brk(0x833d000)                          = 0x833d000
brk(0x833e000)                          = 0x833e000
brk(0x833f000)                          = 0x833f000
brk(0x8340000)                          = 0x8340000
brk(0x8341000)                          = 0x8341000
brk(0x8342000)                          = 0x8342000
brk(0x8343000)                          = 0x8343000
brk(0x8344000)                          = 0x8344000
brk(0x8345000)                          = 0x8345000
brk(0x8346000)                          = 0x8346000
brk(0x8347000)                          = 0x8347000
brk(0x8349000)                          = 0x8349000
brk(0x834a000)                          = 0x834a000
brk(0x834b000)                          = 0x834b000
brk(0x834c000)                          = 0x834c000
brk(0x834d000)                          = 0x834d000
brk(0x834e000)                          = 0x834e000
brk(0x834f000)                          = 0x834f000
open("/usr/local/Zend/lib/ZendOptimizer.so", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240|\1"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=564484, ...}) = 0
old_mmap(NULL, 570248, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x408c0000
mprotect(0x4093f000, 50056, PROT_NONE)  = 0
old_mmap(0x4093f000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x7e000) = 0x4093f000
old_mmap(0x40949000, 9096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40949000
close(3)                                = 0
mprotect(0x408c0000, 520192, PROT_READ|PROT_WRITE) = 0
mprotect(0x408c0000, 520192, PROT_READ|PROT_EXEC) = 0
brk(0x8350000)                          = 0x8350000
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={30, 0}}, NULL) = 0
rt_sigaction(SIGPROF, {0x407fce90, [PROF], SA_RESTART|0x4000000}, {SIG_DFL}, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [PROF], NULL, 8) = 0
brk(0x8351000)                          = 0x8351000
brk(0x8352000)                          = 0x8352000
brk(0x8353000)                          = 0x8353000
gettimeofday({1114033050, 24932}, NULL) = 0
getpid()                                = 29761
write(1, "PHP 4.3.10 (cgi) (built: Dec 21 "..., 225PHP 4.3.10 (cgi) (built: Dec 21 2004 15:04:42)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
    with Zend Optimizer v2.5.7, Copyright (c) 1998-2004, by Zend Technologies
) = 225
_exit(1)                                = ?



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-21 00:22 UTC] sniper@php.net
Do not file bugs when you have Zend extensions (zend_extension=)
loaded. Examples are Zend Optimizer, Zend Debugger, Turck MM Cache,
APC, Xdebug and ionCube loader.  These extensions often modify engine
behavior which is not related to PHP itself.


 [2005-04-21 00:33 UTC] johnw at netnation dot com
Where you see the Zend extenions was from the working 4.3.10 binary.  The 4.3.11 doesn't even get there.  Nevertheless, I commented out the entries for Zend extensions in the php.ini.  php 4.3.10 works while 4.3.11 still segfaults on a -v

/usr/bin/php -v
PHP 4.3.10 (cgi) (built: Dec 21 2004 15:04:42)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

./php -v
Segmentation fault (core dumped)
 [2005-04-21 12:46 UTC] sniper@php.net
Provide a GDB backtrace by doing this:

# gdb php
(gdb) run -v

 [2005-04-21 18:56 UTC] johnw at netnation dot com
This GDB was configured as "i386-redhat-linux"...
(gdb) run -v
Starting program: /home/redhat/BUILD/php-4.3.11/build-cgi/sapi/cgi/php -v
[New Thread 1024 (LWP 20356)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 20356)]
0x4207fb98 in strcmp () from /lib/i686/libc.so.6
(gdb) 
(gdb) backtrace 
#0  0x4207fb98 in strcmp () from /lib/i686/libc.so.6
#1  0x402b15dd in PNVersion () from /usr/local/lib/libpfpro.so
 [2005-04-21 22:49 UTC] iliaa@php.net
Crash is inside an external library, not a PHP bug.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 09 06:01:26 2024 UTC