ID: 49098
Updated by: timj@php.net
Reported By: bugs at timj dot co dot uk
-Status: Feedback
+Status: Open
Bug Type: Session related
Operating System: Linux
PHP Version: 5.2.10
New Comment:
Recompiled with --enable-debug and -O1, the backtrace is very similar
to that reported right at the start of the bug, and not very helpful:
#0 0x0000000000600d2d in _zend_mm_free_int ()
#1 0x0000000000600fc9 in _efree ()
#2 0x00000000005b651f in php_version_compare ()
#3 0x00000000005b6596 in zif_version_compare ()
#4 0x000000000063df7a in zend_do_fcall_common_helper_SPEC ()
#5 0x000000000063e53f in ZEND_DO_FCALL_SPEC_CONST_HANDLER ()
#6 0x000000000063a63d in execute ()
#7 0x000000000063e076 in zend_do_fcall_common_helper_SPEC ()
#8 0x000000000063e453 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER ()
#9 0x000000000063a63d in execute ()
#10 0x000000000063e076 in zend_do_fcall_common_helper_SPEC ()
#11 0x000000000063e453 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER ()
#12 0x000000000063a63d in execute ()
#13 0x000000000063e076 in zend_do_fcall_common_helper_SPEC ()
#14 0x000000000063e453 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER ()
#15 0x000000000063a63d in execute ()
#16 0x000000000063e076 in zend_do_fcall_common_helper_SPEC ()
#17 0x000000000063e453 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER ()
#18 0x000000000063a63d in execute ()
#19 0x000000000060ff69 in zend_call_function ()
#20 0x000000000061021b in call_user_function_ex ()
#21 0x00000000006103ef in call_user_function ()
#22 0x00000000005146ac in ps_call_handler ()
#23 0x00000000005148f4 in ps_write_user ()
#24 0x000000000050e381 in php_session_flush ()
#25 0x000000000050f4f6 in zm_deactivate_session ()
#26 0x000000000061b4be in module_registry_cleanup ()
#27 0x0000000000623a51 in zend_hash_reverse_apply ()
#28 0x000000000061a1ff in zend_deactivate_modules ()
#29 0x00000000005db184 in php_request_shutdown ()
#30 0x0000000000683ecc in main ()
Now, what's really interesting is that with -O0 and the exact same
configure options, the segfault doesn't happen. Maybe this helps to
pinpoint the cause?
Previous Comments:
------------------------------------------------------------------------
[2009-11-08 22:43:24] timj@php.net
With my original compile as per instructions above (the compiler got
-O2 by default):
#0 _zend_mm_alloc_int (heap=0x9e32b0, size=12)
at /path/to/php5.2-200911070930/Zend/zend_alloc.c:1785
#1 0x000000000048227e in php_pcre_match_impl (pce=<value optimized
out>,
subject=<value optimized out>, subject_len=<value optimized out>,
return_value=<value optimized out>, subpats=0x0, global=0,
use_flags=0,
flags=<value optimized out>, start_offset=0)
at /path/to/php5.2-200911070930/ext/pcre/php_pcre.c:603
#2 0x0000000000482ccd in php_do_pcre_match (ht=2,
return_value=0xd584a0,
return_value_ptr=<value optimized out>, this_ptr=<value optimized
out>,
return_value_used=<value optimized out>, global=0)
at /path/to/php5.2-200911070930/ext/pcre/php_pcre.c:513
#3 0x0000000000659303 in zend_do_fcall_common_helper_SPEC (
execute_data=0x7fffffffc420)
at /path/to/php5.2-200911070930/Zend/zend_vm_execute.h:200
#4 0x000000000065522c in execute (op_array=0xd83190)
at /path/to/php5.2-200911070930/Zend/zend_vm_execute.h:92
#5 0x0000000000658c76 in zend_do_fcall_common_helper_SPEC (
execute_data=0x7fffffffc740)
at /path/to/php5.2-200911070930/Zend/zend_vm_execute.h:234
#6 0x000000000065522c in execute (op_array=0xd37808)
at /path/to/php5.2-200911070930/Zend/zend_vm_execute.h:92
#7 0x0000000000658c76 in zend_do_fcall_common_helper_SPEC (
execute_data=0x7fffffffd660)
------------------------------------------------------------------------
[2009-11-08 21:11:07] srinatar@php.net
thanks for taking time and trying to reproduce this issue. can u kindly
provide / attach stack trace when this issue happens... this would help
us identify us as to what is happening at ur end..
u can enable core dump by doing some thing like
ulimit -c unlimited
now, u can run your program to generate core dump and provide us the
stack trace as mentioned in this below link..
http://bugs.php.net/bugs-generating-backtrace.php
------------------------------------------------------------------------
[2009-11-08 19:10:35] timj@php.net
After spending an enormous amount of time testing endless combinations
of compile and runtime options, I have hopefully found the key to
solving this obscure bug. The segfault only happens specifically if the
following is true:
- the mbstring extension is enabled, *AND*
- the mssql extension is enabled (particularly weird because the test
script does not use mssql in any way)
In the hope of making the reproduction scenario more robust, I have
pared down the configure line to a minimum and here is the exact
environment, from source tarball, which I can reproduce it in:
OS: Fedora 11 x86_64 (fully updated as at 2009-11-08)
Notable dependencies:
mysql-devel-5.1.37-1.fc11.x86_64
freetds-devel-0.82-5.fc11.x86_64
gcc version 4.4.1 20090725 (Red Hat 4.4.1-2) (GCC)
Download snapshot 200911070930 from snaps.php.net
tar -jxf php5.2-200911070930.tar.bz2
cd php5.2-200911070930
./configure --includedir=/usr/include --libdir=/usr/lib64
--with-libdir=lib64 --without-pear
--with-mysqli=shared,/usr/bin/mysql_config --enable-mbstring=shared
--enable-mbregex --with-mssql=shared,/usr
make -j3
make install # as root
create /usr/local/etc/php.ini containing only the following:
extension=mbstring.so
extension=mssql.so
extension=mysqli.so
include_path=/path/to/pear/php
$ /usr/local/bin/php -c /usr/local/etc/php.ini php-bug49098.php #
script posted on 11 Aug
Segmentation fault
Commenting out EITHER "extension=mbstring.so" or "extension=mssql.so"
in /usr/local/etc/php.ini stops the segfault.
Can anyone else now reproduce this with the above environment? Is there
any other information about the environment that I need to provide?
------------------------------------------------------------------------
[2009-09-26 10:54:13] timj@php.net
1. Still segfaults for me with the release version of 5.2.11, with
MySQLi connection (mysql client libs and server 5.1.37).
-> Sriram, I also tried with your test script (just to make sure there
wasn't a subtle difference from mine) and it also segfaulted.
-> Segfault is still in the same place as originally.
2. snap-200909261030 doesn't build atm (error in mysqli_api)
What more info can I give to assist?
------------------------------------------------------------------------
[2009-09-24 19:32:19] srinatar@php.net
unable to reproduce with the earlier provided test case. so, need more
information to reproduce / investigate this bug . also, would be useful
to know if this still happens with either 5.2.11 (or latest svn
snapshot)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/49098
--
Edit this bug report at http://bugs.php.net/?id=49098&edit=1