Edit report at https://bugs.php.net/bug.php?id=64893&edit=1

 ID:                 64893
 Comment by:         arjen at react dot com
 Reported by:        ni...@php.net
 Summary:            Crash due to dtor call happening after dtor shutdown
 Status:             Open
 Type:               Bug
 Package:            Scripting Engine problem
 PHP Version:        5.5.0RC1
 Block user comment: N
 Private report:     N

 New Comment:

The result '/home/nikic/dev/php-dev/Zend/zend_hash.c(946) : ht=0x42dea5c is 
already destroyed' only happens in a debug build.

In a normal build, a notice about a undefined variable $GLOBALS is generated: 
http://3v4l.org/jcBu6


Previous Comments:
------------------------------------------------------------------------
[2013-05-21 22:42:59] ni...@php.net

Description:
------------
If an object is created *after* the destructor shutdown, its dtor will be 
called when it is freed, which potentially happens during a phase of the 
shutdown process where the executor is no longer in a consistent state.

The test script uses the ob callback (called after dtor shutdown) to create an 
object and bind it to to the error callback, which is later freed during 
zend_deactivate, as part of the executor shutdown.

Result:
/home/nikic/dev/php-dev/Zend/zend_hash.c(946) : ht=0x42dea5c is already 
destroyed

Test script:
---------------
<?php
 
ob_start(function() {
    $foo = new Foo;
    set_error_handler(function() use ($foo) {});
});

class Foo {
    public function __destruct() {
        var_dump($GLOBALS);
    }
}




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



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

Reply via email to