Bug #51425 [Fbk->Opn]: segfaults at method_exists()

[email protected] ("jimmyxx at gmail dot com") Tue, 30 Mar 2010 11:00:35 +0200 (CEST)
Newsgroups php.bugs
Message-ID <[email protected]>
Edit report at http://bugs.php.net/bug.php?id=51425&edit=1

 ID:               51425
 User updated by:  jimmyxx at gmail dot com
 Reported by:      jimmyxx at gmail dot com
 Summary:          segfaults at method_exists()
-Status:           Feedback
+Status:           Open
 Type:             Bug
 Package:          Class/Object related
 Operating System: Ubuntu 9.10
 PHP Version:      5.2.13

 New Comment:

Hi, This was the first full backtrace from my core file:

#0  0x0125f642 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#1  0x0127052b in execute_internal () from
/usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#2  0x001ec2af in xdebug_execute_internal
(current_execute_data=0xbfd1ef2c, 
return_value_used=1)
    at /build/buildd/xdebug-2.0.4/build-php5/xdebug.c:1630
        edata = 0xbfd1ef2c
        fse = 0x21a576a0
        cur_opcode = 0xa
        do_return = 0
        function_nr = 5917
#3  0x0127920c in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#4  0x0127504b in execute () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#5  0x001ebf6b in xdebug_execute (op_array=0x21b565e4) at
/build/buildd/xdebug-
2.0.4/build-php5/xdebug.c:1561
        dummy = 0xbfd1f3dc
        edata = 0xbfd1f3dc
        fse = 0x21a5a638
        xfse = 0xbfd1f018
        magic_cookie = 0x0
        do_return = 0
        function_nr = 5907
        le = 0x21b46354
        eval_id = 0
        return_val = 0x0
#6  0x01278df9 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#7  0x0127504b in execute () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#8  0x001ebf6b in xdebug_execute (op_array=0x21a74fbc) at
/build/buildd/xdebug-
2.0.4/build-php5/xdebug.c:1561
        dummy = 0x126ed50
        edata = 0xbfd1f65c
        fse = 0x21a5b560
        xfse = 0x21b24934
        magic_cookie = 0x0
        do_return = 0
        function_nr = 5902
        le = 0x21a70690
       eval_id = 0
        return_val = 0x0
#9  0x01278df9 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#10 0x0127504b in execute () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#11 0x001ebf6b in xdebug_execute (op_array=0x21a7226c) at
/build/buildd/xdebug-
2.0.4/build-php5/xdebug.c:1561
        dummy = 0x14cd8a4
        edata = 0xbfd1f89c
        fse = 0x21a59508
        xfse = 0xbf006f67
        magic_cookie = 0x0
        do_return = 0
        function_nr = 5900
        le = 0x21a10bec
        eval_id = 0
        return_val = 0x0
#12 0x01278df9 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#13 0x0127504b in execute () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#14 0x001ebf6b in xdebug_execute (op_array=0x21a2321c) at
/build/buildd/xdebug-
2.0.4/build-php5/xdebug.c:1561
        dummy = 0x126ed50
        edata = 0xbfd1fb0c
        fse = 0x21a5be08
        xfse = 0x125b8ae
        magic_cookie = 0x0
        do_return = 0
        function_nr = 5899
        le = 0x21a132a0
        eval_id = 0
        return_val = 0x0
#15 0x01278df9 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#16 0x0127504b in execute () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#17 0x001ebf6b in xdebug_execute (op_array=0x21a22f20) at
/build/buildd/xdebug-
2.0.4/build-php5/xdebug.c:1561
        dummy = 0x14a3ff4
        edata = 0xbfd200cc
        fse = 0x21a5b6d8
        xfse = 0x125b8ae
        magic_cookie = 0x0
        do_return = 0
        function_nr = 5896
        le = 0x52
        eval_id = 0
        return_val = 0x0
#18 0x01278df9 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#19 0x0127504b in execute () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#20 0x001ebf6b in xdebug_execute (op_array=0x21a102fc) at
/build/buildd/xdebug-
2.0.4/build-php5/xdebug.c:1561
        dummy = 0x14a3ff4
        edata = 0x0
        fse = 0x21a570a0
        xfse = 0x14cdbf4
        magic_cookie = 0x0
        do_return = 0
        function_nr = 0
        le = 0xbfd2242c
        eval_id = 0
        return_val = 0x0
#21 0x0124f4d4 in zend_execute_scripts () from 
/usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#22 0x01204246 in php_execute_script () from
/usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#23 0x012c5f13 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#24 0x0096cf51 in ap_run_handler () from /usr/sbin/apache2
No symbol table info available.
#25 0x00970d2f in ap_invoke_handler () from /usr/sbin/apache2
No symbol table info available.
#26 0x009803f4 in ap_internal_redirect () from /usr/sbin/apache2
No symbol table info available.
#27 0x0018c80d in ?? () from /usr/lib/apache2/modules/mod_rewrite.so
No symbol table info available.
#28 0x0096cf51 in ap_run_handler () from /usr/sbin/apache2
No symbol table info available.
#29 0x00970d2f in ap_invoke_handler () from /usr/sbin/apache2
No symbol table info available.
#30 0x009805a8 in ap_process_request () from /usr/sbin/apache2
No symbol table info available.
#31 0x0097d118 in ?? () from /usr/sbin/apache2
No symbol table info available.
#32 0x009757c1 in ap_run_process_connection () from /usr/sbin/apache2
No symbol table info available.
#33 0x00985ac1 in ?? () from /usr/sbin/apache2
No symbol table info available.
#34 0x00985dee in ?? () from /usr/sbin/apache2
No symbol table info available.
#35 0x00986d9b in ap_mpm_run () from /usr/sbin/apache2
No symbol table info available.
#36 0x00957a92 in main () from /usr/sbin/apache2
No symbol table info available.


I then recompiled php with the -enable-debug flag and got the
following:

#0  0x0133da5d in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#1  0x01355f52 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#2  0x01359ca9 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#3  0x01355a8b in execute () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#4  0x0135610d in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#5  0x01356687 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#6  0x01355a8b in execute () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#7  0x0135610d in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#8  0x01356687 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#9  0x01355a8b in execute () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#10 0x0135610d in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#11 0x01356687 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#12 0x01355a8b in execute () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#13 0x0135610d in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#14 0x01356687 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#15 0x01355a8b in execute () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#16 0x0135610d in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#17 0x01356687 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#18 0x01355a8b in execute () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#19 0x0132addc in zend_execute_scripts () from 
/usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#20 0x012ce998 in php_execute_script () from
/usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#21 0x013ad5b4 in ?? () from /usr/lib/apache2/modules/libphp5.so
No symbol table info available.
#22 0x00c63f51 in ap_run_handler () from /usr/sbin/apache2
No symbol table info available.
#23 0x00c67d2f in ap_invoke_handler () from /usr/sbin/apache2
No symbol table info available.
#24 0x00c773f4 in ap_internal_redirect () from /usr/sbin/apache2
No symbol table info available.
#25 0x0039c80d in ?? () from /usr/lib/apache2/modules/mod_rewrite.so
No symbol table info available.
#26 0x00c63f51 in ap_run_handler () from /usr/sbin/apache2
No symbol table info available.
#27 0x00c67d2f in ap_invoke_handler () from /usr/sbin/apache2
No symbol table info available.
#28 0x00c775a8 in ap_process_request () from /usr/sbin/apache2
No symbol table info available.
#29 0x00c74118 in ?? () from /usr/sbin/apache2
No symbol table info available.
#30 0x00c6c7c1 in ap_run_process_connection () from /usr/sbin/apache2
No symbol table info available.
#31 0x00c7cac1 in ?? () from /usr/sbin/apache2
No symbol table info available.
#32 0x00c7cdee in ?? () from /usr/sbin/apache2
No symbol table info available.
#33 0x00c7d1c2 in ap_mpm_run () from /usr/sbin/apache2
No symbol table info available.
#34 0x00c4ea92 in main () from /usr/sbin/apache2
No symbol table info available.


Not sure if the bottom one has worked correctly.

Thanks


Previous Comments:
------------------------------------------------------------------------
[2010-03-29 15:36:50] [email protected]

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.



------------------------------------------------------------------------
[2010-03-29 14:59:44] jimmyxx at gmail dot com

Description:
------------
Hi,

This bug has occurred on 3 separate projects all using the same in house
PHP 
framework. All 3 changes that occurred just before the apps started
sefgaulting 
are very different but on each occasion the segfault can be traced back
to 
method_exists() which features in the frameworks URL parser. 

The method_exists() in all 3 cases was being called with valid arguments
and 
should have returned true.

In one project PHP started segfaulting when an object that has been
unseralized 
from memcache was accessed.

On another project (the one i've been fighting with all day) PHP started

segfaulting when an extra class was added in to the OO extends daisy
chain. (eg 
instead of: class a extends x {} it now reads class a extends y {} and
class y 
extends x {} - class Y can be a blank class and it still causes the
segfault..).

For the project mentioned immediately above I've tried taking the url
parser, 
and all related files out so I could run a controlled test and when run

independently it works absolutely fine which makes me think
method_exists is a 
red-herring and something else is causing method_exists to segfault.

Also it's worth mentioning that the urlparser works fine and is used on
many 
high-traffic websites. It's also called very near the top of the url
parsers 
code and the couple of bits above are trivial and won't be related.

I've never managed to figure out why method_exists segfaults and I've
always had 
to work around the bug - finding what change was made just before it
started 
segfaulting and simply finding a different solution.

Can anyone help me in figuring out what's going on here? Or what
method_exists 
does that could cause it segfault (ie: is PHP running out of file
handles or 
something?)

Any help would be much appreciated.



------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51425&edit=1