View Issue Details

IDProjectCategoryView StatusLast Update
0000074XdebugUncategorizedpublic2004-07-13 11:03
ReporterPerGustafsson Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionopen 
Summary0000074: Seg. fault
Description

PHP 5.0.0RC3 with xdebug 1.3.2 generates a segmentation fault, the particular line is:

$mail_template->assign('view_caption', Easy_Button::button($captions['view_caption']));

And the error goes away if I do:

$foo = Easy_Button::button($captions['view_caption']);
$mail_template->assign('view_caption', $foo);

It is part of a fairly complex application and I've been unable to make a simple script to isolate and reproduce the bug.

Additional Information

(gdb) bt
#0 0x40538ef3 in xdebug_build_fname (tmp=0x8466b80, edata=0xbfff66e0) at /tmp/tmpMRn5zk/xdebug-1.3.2/xdebug.c:539
#1 0x405391ec in add_stack_frame (zdata=0xbfff66e0, op_array=0x8423ea0, type=2) at /tmp/tmpMRn5zk/xdebug-1.3.2/xdebug.c:625
0000002 0x405397ed in xdebug_execute (op_array=0x8423ea0) at /tmp/tmpMRn5zk/xdebug-1.3.2/xdebug.c:786
0000003 0x08216364 in zend_call_function (fci=0xbfff6790, fci_cache=0x0)
at /storage/install/php-5.0.0RC3/Zend/zend_execute_API.c:835
0000004 0x0821559f in call_user_function_ex (function_table=0x8392778, object_pp=0x0, function_name=0xbfff6830,
retval_ptr_ptr=0xbfff6818, param_count=1, params=0xbfff684c, no_separation=0, symbol_table=0x0)
at /storage/install/php-5.0.0RC3/Zend/zend_execute_API.c:550
0000005 0x082166f2 in zend_lookup_class (name=0x405bfe0c "Easy_Button", name_length=11, ce=0xbfff6874)
at /storage/install/php-5.0.0RC3/Zend/zend_execute_API.c:923
0000006 0x08216e22 in zend_fetch_class (class_name=0x405bfe0c "Easy_Button", class_name_len=11, fetch_type=0)
at /storage/install/php-5.0.0RC3/Zend/zend_execute_API.c:1277
0000007 0x08244b6d in zend_fetch_class_handler (execute_data=0xbfffae90, opline=0x40617000, op_array=0x405bf270)
at /storage/install/php-5.0.0RC3/Zend/zend_execute.c:2438
0000008 0x082422f9 in execute (op_array=0x405bf270) at /storage/install/php-5.0.0RC3/Zend/zend_execute.c:1389
0000009 0x40539992 in xdebug_execute (op_array=0x405bf270) at /tmp/tmpMRn5zk/xdebug-1.3.2/xdebug.c:825
0000010 0x08245640 in zend_do_fcall_common_helper (execute_data=0xbfffb670, opline=0x404e4a58, op_array=0x405c9360)
at /storage/install/php-5.0.0RC3/Zend/zend_execute.c:2726
0000011 0x08245a33 in zend_do_fcall_by_name_handler (execute_data=0xbfffb670, opline=0x404e4a58, op_array=0x405c9360)
at /storage/install/php-5.0.0RC3/Zend/zend_execute.c:2808
0000012 0x082422f9 in execute (op_array=0x405c9360) at /storage/install/php-5.0.0RC3/Zend/zend_execute.c:1389
0000013 0x40539992 in xdebug_execute (op_array=0x405c9360) at /tmp/tmpMRn5zk/xdebug-1.3.2/xdebug.c:825
0000014 0x08245640 in zend_do_fcall_common_helper (execute_data=0xbfffd260, opline=0x404dbda0, op_array=0x404c8f18)
at /storage/install/php-5.0.0RC3/Zend/zend_execute.c:2726
0000015 0x08245a33 in zend_do_fcall_by_name_handler (execute_data=0xbfffd260, opline=0x404dbda0, op_array=0x404c8f18)
at /storage/install/php-5.0.0RC3/Zend/zend_execute.c:2808
0000016 0x082422f9 in execute (op_array=0x404c8f18) at /storage/install/php-5.0.0RC3/Zend/zend_execute.c:1389
0000017 0x405399ba in xdebug_execute (op_array=0x404c8f18) at /tmp/tmpMRn5zk/xdebug-1.3.2/xdebug.c:828
0000018 0x08221847 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /storage/install/php-5.0.0RC3/Zend/zend.c:1061
0000019 0x081e1e10 in php_execute_script (primary_file=0xbffffab0) at /storage/install/php-5.0.0RC3/main/main.c:1627
0000020 0x0824df38 in main (argc=2, argv=0xbffffb54) at /storage/install/php-5.0.0RC3/sapi/cli/php_cli.c:943
0000021 0x4039c657 in __libc_start_main (main=0x824d400 <main>, argc=2, ubp_av=0xbffffb54, init=0x8080718 <_init>,
fini=0x829e7d0 <_fini>, rtld_fini=0x4000dcd4 <_dl_fini>, stack_end=0xbffffb4c) at ../sysdeps/generic/libc-start.c:129

TagsNo tags attached.
Operating SystemLinux 2.4.18-19.7.x
PHP Version5.0.0rc3

Activities

derick

2004-07-12 17:27

administrator   ~0000150

A script to reproduce would really help me finding this bug. Can you also show me the lines before you enter "bt" at the GDB prompt, that usually shows better where the crash is.

PerGustafsson

2004-07-13 08:19

reporter   ~0000151

This is the line before running bt:

0x40538ef3 in xdebug_build_fname (tmp=0x8420c10, edata=0xbfffca40) at /tmp/tmpMRn5zk/xdebug-1.3.2/xdebug.c:539
539

I spent some time isolating the crash and managed to come up with the following, let me know if you have any questions:

<?
class Reproduce_Crash {

private function foo() { 
    // Wrapping the call through this bogus
    // method is needed to reproduce the crash
    //
    // It must be either private or public to
    // crash (i.e. not static)
    //
    // It does not matter if it takes or returns
    // any arguments.
}

public function CrashMe() {
    // This far everything works and would work
    // 
    // Now here's where things goes belly up:
    // I haven't tried a lot of varities but I
    // do know that the class and method name
    // is irrelevant as long as it a) not exists
    // and b) the script has an __autload function
    // defined.
    //
    $this->foo(AnyClass::blah());
}

}

function __autoload($class){
// It does matter if this contain any code
// or not, or if it loads the class.
}

// Creates a new instance of Reproduce_Crash
// It does not matter if Reproduce_Crash is loaded with the help of
// __autoload or not.

$foo = new Reproduce_Crash;

// Calls a method of Reproduce_Crash
$foo->CrashMe($action);
?>

PerGustafsson

2004-07-13 08:27

reporter   ~0000152

Sending the argument $action is not needed, it's there by mistake.

derick

2004-07-13 11:03

administrator   ~0000153

This is fixed in CVS (1.3.3-dev). HEAD which contains (2.0.0dev) already has this patch.

Issue History

Date Modified Username Field Change
2004-07-12 09:59 PerGustafsson New Issue
2004-07-12 17:27 derick Note Added: 0000150
2004-07-12 17:27 derick Status new => feedback
2004-07-13 08:19 PerGustafsson Note Added: 0000151
2004-07-13 08:27 PerGustafsson Note Added: 0000152
2004-07-13 11:03 derick Status feedback => closed
2004-07-13 11:03 derick Note Added: 0000153
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized