[php-maint] Bug#493045: Segmentation Fault in cron console PHP Job

Helmut helmutjd at gmail.com
Mon Sep 15 22:23:55 UTC 2008


Hello all,

I'm experiencing this same issue and hopefully I can address some of the 
unanswered questions above.  There was some talk about this being 
related to 495575 but I'm using php5-mysql 5.2.6-3 and 
libmysqlclient15off 5.0.51a-12 and I'm still seeing this behavior.

To answer some earlier questions from this report:
- it's not dependent on any particular PHP script; even linting will 
intermittently cause a segfault (i.e. echo test>test.php; php -l test.php)
- the segmentation faults are intermittent; if you run a simple BASH for 
loop calling "php -q test.php" a few dozen times, it'll segfault on 
roughly 30% of the loop iterations (see below)
- it's somehow directly related to the MySQL extension; removing 
/etc/php5/conf.d/mysql*.ini resolves the problem
- it doesn't appear to be a conflict or load-order issue with any other 
extension; I've tried removing all but the MySQL extension and it still 
segfaults; as soon as you remove the MySQL extension all is well

my setup:

root at titanium:/tmp/bt# cat /etc/debian_version
lenny/sid

root at titanium:/tmp/bt# dpkg -l | grep mysql | awk '{print $2 " " $3}'
libdbd-mysql-perl 4.007-1
libmysqlclient15-dev 5.0.51a-12
libmysqlclient15off 5.0.51a-12
mysql-client 5.0.51a-12
mysql-client-5.0 5.0.51a-12
mysql-common 5.0.51a-12
mysql-server-5.0 5.0.51a-12
php4-mysql 6:4.4.4-9+lenny1
php5-mysql 5.2.6-3

root at titanium:/tmp/bt# dpkg -l | grep php5- | awk '{print $2 " " $3}'
php5-cli 5.2.6-3
php5-common 5.2.6-3
php5-curl 5.2.6-3
php5-dbg 5.2.6-3
php5-dev 5.2.6-3
php5-gd 5.2.6-3
php5-imap 5.2.6-3
php5-interbase 5.2.6-3
php5-mcrypt 5.2.6-3
php5-mysql 5.2.6-3


backtrace:

root at titanium:/tmp/bt# echo test > test.php

root at titanium:/tmp/bt# ulimit -c unlimited; for f in `seq 0 10`; do php 
-l test.php; done
No syntax errors detected in test.php
No syntax errors detected in test.php
No syntax errors detected in test.php
No syntax errors detected in test.php
No syntax errors detected in test.php
No syntax errors detected in test.php
No syntax errors detected in test.php
No syntax errors detected in test.php
Segmentation fault (core dumped)
No syntax errors detected in test.php
No syntax errors detected in test.php
Segmentation fault (core dumped)
No syntax errors detected in test.php

root at titanium:/tmp/bt# gdb /usr/bin/php /tmp/bt/core.30230
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/i686/nosegneg/libcrypt.so.1...done.
Loaded symbols for /lib/i686/nosegneg/libcrypt.so.1
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /usr/lib/libpanel.so.5...done.
Loaded symbols for /usr/lib/libpanel.so.5
Reading symbols from /lib/libncurses.so.5...done.
Loaded symbols for /lib/libncurses.so.5
Reading symbols from /usr/lib/i686/cmov/libssl.so.0.9.8...done.
Loaded symbols for /usr/lib/i686/cmov/libssl.so.0.9.8
Reading symbols from /usr/lib/libdb-4.6.so...done.
Loaded symbols for /usr/lib/libdb-4.6.so
Reading symbols from /lib/libbz2.so.1.0...done.
Loaded symbols for /lib/libbz2.so.1.0
Reading symbols from /usr/lib/libpcre.so.3...done.
Loaded symbols for /usr/lib/libpcre.so.3
Reading symbols from /lib/i686/nosegneg/libresolv.so.2...done.
Loaded symbols for /lib/i686/nosegneg/libresolv.so.2
Reading symbols from /lib/i686/nosegneg/libm.so.6...done.
Loaded symbols for /lib/i686/nosegneg/libm.so.6
Reading symbols from /lib/i686/nosegneg/libdl.so.2...done.
Loaded symbols for /lib/i686/nosegneg/libdl.so.2
Reading symbols from /lib/i686/nosegneg/libnsl.so.1...done.
Loaded symbols for /lib/i686/nosegneg/libnsl.so.1
Reading symbols from /usr/lib/libgssapi_krb5.so.2...done.
Loaded symbols for /usr/lib/libgssapi_krb5.so.2
Reading symbols from /usr/lib/libkrb5.so.3...done.
Loaded symbols for /usr/lib/libkrb5.so.3
Reading symbols from /usr/lib/libk5crypto.so.3...done.
Loaded symbols for /usr/lib/libk5crypto.so.3
Reading symbols from /lib/libcom_err.so.2...done.
Loaded symbols for /lib/libcom_err.so.2
Reading symbols from /usr/lib/libxml2.so.2...done.
Loaded symbols for /usr/lib/libxml2.so.2
Reading symbols from /lib/i686/nosegneg/libc.so.6...done.
Loaded symbols for /lib/i686/nosegneg/libc.so.6
Reading symbols from /usr/lib/i686/cmov/libcrypto.so.0.9.8...done.
Loaded symbols for /usr/lib/i686/cmov/libcrypto.so.0.9.8
Reading symbols from /lib/i686/nosegneg/libpthread.so.0...done.
Loaded symbols for /lib/i686/nosegneg/libpthread.so.0
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /usr/lib/libkrb5support.so.0...done.
Loaded symbols for /usr/lib/libkrb5support.so.0
Reading symbols from /lib/libkeyutils.so.1...done.
Loaded symbols for /lib/libkeyutils.so.1
Reading symbols from 
/usr/lib/php5/20060613+lfs/ioncube_loader_lin_5.2.so...done.
Loaded symbols for /usr/lib/php5/20060613+lfs/ioncube_loader_lin_5.2.so
Reading symbols from /lib/i686/nosegneg/librt.so.1...done.
Loaded symbols for /lib/i686/nosegneg/librt.so.1
Reading symbols from /lib/i686/nosegneg/libnss_files.so.2...done.
Loaded symbols for /lib/i686/nosegneg/libnss_files.so.2
Failed to read a valid object file image from memory.
Core was generated by `php -l test.php'.
Program terminated with signal 11, Segmentation fault.
[New process 30231]
[New process 30230]
#0  0xb6bdfe60 in ?? ()
(gdb) bt
#0  0xb6bdfe60 in ?? ()
#1  0xb781f506 in start_thread () from /lib/i686/nosegneg/libpthread.so.0
#2  0xb7a685be in clone () from /lib/i686/nosegneg/libc.so.6
(gdb) quit


removing the mysql extension:

root at titanium:/tmp/bt# mkdir mysql && mv /etc/php5/conf.d/mysql* mysql
root at titanium:/tmp/bt# for f in `seq 0 100`; do php -l test.php; done | 
grep -c 'No syntax'
101

If I can provide any further info, just let me know.

Thanks,
Steve






More information about the pkg-php-maint mailing list