logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Bug 0000095: Crashes in PHP-CLI and PHP-Apache: msg#00023

Subject: Bug 0000095: Crashes in PHP-CLI and PHP-Apache
The following bug has been REOPENED.
======================================================================
http://bugs.xdebug.org/bug_view_page.php?bug_id=0000095
======================================================================
Reporter:                   su1d
Handler:                    derick
======================================================================
Project:                    Xdebug
Bug ID:                     95
Category:                   Usage problems
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     feedback
Operating System:           Windows XP SP2
PHP Version:                5.1.0-dev
Xdebug Version:             2.0-dev
======================================================================
Date Submitted:             2004-10-20 08:50 CEST
Last Modified:              2005-03-29 22:41 CEST
======================================================================
Summary:                    Crashes in PHP-CLI and PHP-Apache
Description: 
as I already stated on php.pecl.dev,
PHP-CLI and PHP-Apache crash out with Xdebug2 installed, although it works
okay with PHP-CGI.

Apache -- the last 1.3.x version
PHP -- 5.1.x-dev last snapshot
XDebug -- 2.x last snapshot

======================================================================

----------------------------------------------------------------------
 derick - 2004-11-05 00:13 CET 
----------------------------------------------------------------------
Should be fixed in CVS by now.

----------------------------------------------------------------------
 su1d - 2004-11-05 00:27 CET 
----------------------------------------------------------------------
negative. 
i'm still having crashes.

PHP-bin: latest snapshost (Built On: Nov 04, 2004 19:30 GMT)
PHP-src: current CVS
xdebug-src: current CVS (binary built with MSVS.NET)

starting PHP-CLI:
C:\>php -v
PHP 5.1.0-dev (cli) (built: Nov  4 2004 20:20:33)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.1.0-dev, Copyright (c) 1998-2004 Zend Technologies
    with Xdebug v2.0.0beta2-dev, Copyright (c) 2002, 2003, 2004, by Derick
Rethans

/*CLI has encountered a problem and needs to close...*/

----------------------------------------------------------------------
 derick - 2005-02-16 11:51 CET 
----------------------------------------------------------------------
Then I really need more information, as it works fine on Linux for me (and
i can't test on Windows). Perhaps you can try the latest snapshots of both
PHP 5.1 and Xdebug one more time?

http://snaps.php.net/win32/php5-win32-latest.zip
http://snaps.php.net/win32/PECL_UNSTABLE/php_xdebug.dll

----------------------------------------------------------------------
 su1d - 2005-02-16 21:40 CET 
----------------------------------------------------------------------
PHP 5.1.0-dev (cli) (built: Jan 29 2005 08:28:31)
both php_xdebug.dll downloaded from snaps.php.net and built from CVS:

php.exe crashes after a script is finished executing.
php-win.exe crashes.
php-cgi.exe doesn't crash at all.

I suppose I have to try it with the latest snapshot, but neither of two
today's snapshots were able to run on my box without crashes.

Either something's wrong with my box (although I doubt about that, since
my currently installed snapshot works well), or there are some bugs in
PHP5.1 snapshots and we have to wait untill they fix them.

I think we should ask someone else who got WinXP installed to test the
module.

----------------------------------------------------------------------
 ZebZiggle - 2005-03-02 02:15 CET 
----------------------------------------------------------------------
I get the same problem under php 5.0 and apache 2. 

Run TestMain.php to repo the problem.

---- TestMain.php -----
<?php

require_once 'TestClasses.php';

$silly = new SillyClass();

$silly->sayHi();

try
{
    $silly->explode();
}
catch(MyException $e)
{
    echo "Caught MyException " . $e;
}

?>

------ TestClasses.php -------
<?php

class MyException extends Exception
{
    public function
    __toString()
    {
       return __CLASS__ . " My Exception";
    }
}

class SillyClass
{
    public function
    sayHi()
    {
        echo "<p>Hello World</p>";
    }
    
    public function
    explode()
    {
        throw new MyException();
    }
}

?>

----------------------------------------------------------------------
 ZebZiggle - 2005-03-02 02:16 CET 
----------------------------------------------------------------------
I should note that this is under Windows (using Komoto).

Exceptions are definitely the cause.

----------------------------------------------------------------------
 Michiel - 2005-03-10 13:00 CET 
----------------------------------------------------------------------
Confirmed using latest PHP 5.1 and Xdebug snapshots. Can't debug here but
will try to get some more information.

----------------------------------------------------------------------
 Michiel - 2005-03-10 13:26 CET 
----------------------------------------------------------------------
No crash using PHP 5.0.3 (as released) and Xdebug snapshot.

----------------------------------------------------------------------
 derick - 2005-03-10 22:14 CET 
----------------------------------------------------------------------
Should be fixed in CVS now - please reopen if problems keep occuring, but
provide a sample script then.

----------------------------------------------------------------------
 su1d - 2005-03-16 23:00 CET 
----------------------------------------------------------------------
Still getting crashes with the latest PHP-5.1 snapshot (Built On: Mar 15,
2005 19:30 GMT) and XDebug-2.0.0beta3-dev.

I've tried that with:
- DLL from snaps.php.net
- DLL from xdebug.org
- DLL, compiled here with MS VS .NET 2005 out of CVS-HEAD source

Also tried to play with options in my php.ini file with no result.

I suppose, the crash appears in RSHUTDOWN or MSHUTDOWN functions, because
everything's executed OK, and when PHP is being terminated, it segfaults
with a common Windows crash-dialog.

This is applied to only php-cli and php-win interfaces. 
php-cgi works OK.

Am I the only one who has the bug? 
Can anyone else confirm it?
What can I do to provide you with more information?

----------------------------------------------------------------------
 derick - 2005-03-20 16:12 CET 
----------------------------------------------------------------------
Fixed by bugreporter himself, thanks!

----------------------------------------------------------------------
 su1d - 2005-03-29 22:41 CEST 
----------------------------------------------------------------------
Actually, the segfault occurs in TSRM/TSRM.c:164 in the line:
resource_types_table[j].dtor(p->storage[j], &p->storage);

Paying attention to
http://cvs.php.net/diff.php/TSRM/TSRM.c?r1=1.57&r2=1.58&ty=u
I have #if'ed out those 3 strings back just like they are in PHP-5.0
and the issue has been resolved immediately.

So, the final code in TSRM.c, that doesn't cause any crash is like this:
        if (p->storage[j]) {
#if MBO_0
                if (resource_types_table && !resource_types_table[j].done &&
resource_types_table[j].dtor) {
                        resource_types_table[j].dtor(p->storage[j], 
&p->storage);
                }
#endif
                free(p->storage[j]);
        }

Bug History
Date Modified  Username       Field                    Change              
======================================================================
2004-10-20 08:50su1d           New Bug                                      
2004-10-20 08:51su1d           Bug Monitored: su1d                          
2004-11-05 00:13derick         Bugnote Added: 0000208                       
2004-11-05 00:13derick         Assigned To               => derick          
2004-11-05 00:13derick         Resolution               open => fixed       
2004-11-05 00:13derick         Status                   new => resolved     
2004-11-05 00:27su1d           Bugnote Added: 0000209                       
2004-11-05 00:27su1d           Resolution               fixed => reopened   
2004-11-05 00:27su1d           Status                   resolved => feedback
2005-02-16 11:51derick         Bugnote Added: 0000230                       
2005-02-16 21:40su1d           Bugnote Added: 0000233                       
2005-03-02 02:15ZebZiggle      Bugnote Added: 0000235                       
2005-03-02 02:16ZebZiggle      Bugnote Added: 0000236                       
2005-03-02 02:17ZebZiggle      Bug Monitored: ZebZiggle                     
2005-03-10 13:00Michiel        Bugnote Added: 0000242                       
2005-03-10 13:26Michiel        Bugnote Added: 0000243                       
2005-03-10 22:14derick         Bugnote Added: 0000244                       
2005-03-10 22:14derick         Status                   feedback => closed  
2005-03-10 22:22su1d           Bug End Monitor: su1d                        
2005-03-16 22:47su1d           Bug Monitored: su1d                          
2005-03-16 23:00su1d           Bugnote Added: 0000249                       
2005-03-16 23:00su1d           Status                   closed => feedback  
2005-03-20 16:12derick         Bugnote Added: 0000251                       
2005-03-20 16:12derick         Status                   feedback => closed  
2005-03-29 22:41su1d           Bugnote Added: 0000252                       
2005-03-29 22:41su1d           Status                   closed => feedback  
======================================================================




<Prev in Thread] Current Thread [Next in Thread>