From: [EMAIL PROTECTED] Operating system: Linux PHP version: 5CVS-2004-04-29 (dev) PHP Bug Type: Zend Engine 2 problem Bug description: debug_print_backtrace() crash PHP when including a file that doesn't exist
Description: ------------ debug_print_backtrace() will crash PHP when called from inside a static function used as custom error handler function. Reproduce code: --------------- <?php class FooBar { static function error() { debug_print_backtrace(); } } set_error_handler(array('FooBar', 'error')); include('foobar.php'); ?> Actual result: -------------- magnus:crash > php crash.php #0 FooBar::error() called at [/home/magnus/Projects/base/tests/crash/crash.php:6] #1 FooBarSegmentation fault (gdb) bt #0 0x40d4cb53 in strlen () from /lib/libc.so.6 #1 0x0839a0a9 in zif_debug_print_backtrace (ht=0, return_value=0x40e24720, this_ptr=0x0, return_value_used=0) at /mnt/data1/Apps/CVS/PHP/php5/Zend/zend_builtin_functions.c:1549 #2 0x083b53a8 in zend_do_fcall_common_helper (execute_data=0xbfffc9d0, opline=0x40e25584, op_array=0x40e2691c) at /mnt/data1/Apps/CVS/PHP/php5/Zend/zend_execute.c:2699 #3 0x083b5bbb in zend_do_fcall_handler (execute_data=0xbfffc9d0, opline=0x40e25584, op_array=0x40e2691c) at /mnt/data1/Apps/CVS/PHP/php5/Zend/zend_execute.c:2828 #1 0x0839a0a9 in zif_debug_print_backtrace (ht=0, return_value=0x40e24720, this_ptr=0x0, return_value_used=0) at /mnt/data1/Apps/CVS/PHP/php5/Zend/zend_builtin_functions.c:1549 ptr = (zend_execute_data *) 0xbfffd060 lineno = 4 function_name = 0x848cf97 "include" filename = 0x40e23c08 "/home/magnus/Projects/base/tests/crash/crash.php" class_name = 0x40e25070 "FooBar" call_type = 0x0 include_filename = 0x40e23c08 "/home/magnus/Projects/base/tests/crash/crash.php" arg_array = (zval *) 0x40e2481c cur_arg_pos = (void **) 0x40e13c90 args = (void **) 0x40e13c74 arg_stack_consistent = 1 frames_on_stack = 1 indent = 1 #2 0x083b53a8 in zend_do_fcall_common_helper (execute_data=0xbfffc9d0, opline=0x40e25584, op_array=0x40e2691c) at /mnt/data1/Apps/CVS/PHP/php5/Zend/zend_execute.c:2699 original_return_value = (zval **) 0x3f7 current_scope = (zend_class_entry *) 0x853e4d8 current_this = (zval *) 0x0 return_value_used = 0 should_change_scope = 0 '\0' #3 0x083b5bbb in zend_do_fcall_handler (execute_data=0xbfffc9d0, opline=0x40e25584, op_array=0x40e2691c) at /mnt/data1/Apps/CVS/PHP/php5/Zend/zend_execute.c:2828 fname = (zval *) 0x40e255a0 -- Edit bug report at http://bugs.php.net/?id=28213&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28213&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28213&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28213&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28213&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28213&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28213&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28213&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28213&r=support Expected behavior: http://bugs.php.net/fix.php?id=28213&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28213&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28213&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28213&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28213&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28213&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28213&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28213&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28213&r=float