[xdebug-dev] Bug 0000074: Seg. fault

From: <xdebug-dev[@]lists.xdebug.org>
Date: Tue, 13 Jul 2004 12:03:08 +0200

The following bug has been CLOSED
======================================================================
http://bugs.xdebug.org/bug_view_page.php?bug_id=0000074
======================================================================
Reporter: PerGustafsson
Handler:
======================================================================
Project: Xdebug
Bug ID: 74
Category: Usage problems
Reproducibility: always
Severity: crash
Priority: normal
Status: closed
Operating System: Linux 2.4.18-19.7.x
PHP Version: 5.0.0rc3
Xdebug Version: 1.3.2
======================================================================
Date Submitted: 2004-07-12 10:59 CEST
Last Modified: 2004-07-13 12:03 CEST
======================================================================
Summary: 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.
======================================================================

----------------------------------------------------------------------
 derick - 2004-07-12 18:27 CEST
----------------------------------------------------------------------
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 09:19 CEST
----------------------------------------------------------------------
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 09:27 CEST
----------------------------------------------------------------------
Sending the argument $action is not needed, it's there by mistake.

----------------------------------------------------------------------
 derick - 2004-07-13 12:03 CEST
----------------------------------------------------------------------
This is fixed in CVS (1.3.3-dev). HEAD which contains (2.0.0dev) already
has this patch.

Bug History
Date Modified Username Field Change
======================================================================
2004-07-12 10:59PerGustafsson New Bug
2004-07-12 16:21PerGustafsson Bug Monitored: PerGustafsson
2004-07-12 18:27derick Bugnote Added: 0000150
2004-07-12 18:27derick Status new => feedback
2004-07-13 09:19PerGustafsson Bugnote Added: 0000151
2004-07-13 09:27PerGustafsson Bugnote Added: 0000152
2004-07-13 12:03derick Bugnote Added: 0000153
2004-07-13 12:03derick Status feedback => closed
======================================================================
Received on Tue Jul 13 2004 - 12:03:14 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:02 BST