ID:               30163
 User updated by:  guth at fiifo dot u-psud dot fr
 Reported By:      guth at fiifo dot u-psud dot fr
-Status:           Feedback
+Status:           Open
 Bug Type:         Zend Engine 2 problem
 Operating System: Linux (mandrake 10)
 PHP Version:      5.0.1
 New Comment:

It works fine with the latest CVS.
I don't get the segmentation fault any more.

Thank you.


Previous Comments:
------------------------------------------------------------------------

[2004-09-26 15:30:47] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip

I ran the code atleast 50 times and it works just fine here.

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

[2004-09-20 09:39:33] guth at fiifo dot u-psud dot fr

Description:
------------
[ bad english, i know ]

It seems that PHP 5 is not very stable.
My code segfaults every 3-4 days :'(

Reproduce code:
---------------
<?php

class B {
}

class A {
        public $b;
        public function __construct() {
                $this->b = new B;
        }
        public function build() {
                return $this->b;
        }
}

class C {

        private $b;

        public function __construct() {
                
                $a = new A();
                $this->b = $a->build();
                
                try {
                        throw new Exception;
                } catch(Exception $e) {
                }

        }

        public function __destruct() {
        
                throw new Exception;

        }

}

$C = new C;

?>

Expected result:
----------------
Something like "An uncaught exception has been thrown..."

Note that the code works as expected if you remove the following lines
:

"$a = new A();
$this->b = $a->build();"

Actual result:
--------------
segmentation fault :)

(gdb) bt
#0  0x08205ec8 in zend_objects_destroy_object (object=0x831ae6c,
handle=3) at /usr/src/php-5.0.1/Zend/zend_objects.c:37
#1  0x082089ec in zend_objects_store_del_ref (zobject=0x831ae2c) at
/usr/src/php-5.0.1/Zend/zend_objects_API.c:144
#2  0x081efe22 in _zval_dtor (zvalue=0x831ae2c,
__zend_filename=0x82641e0
"/usr/src/php-5.0.1/Zend/zend_execute_API.c",
    __zend_lineno=391) at /usr/src/php-5.0.1/Zend/zend_variables.c:61
#3  0x081e465c in _zval_ptr_dtor (zval_ptr=0x8307848,
    __zend_filename=0x8265100
"/usr/src/php-5.0.1/Zend/zend_variables.c", __zend_lineno=193)
    at /usr/src/php-5.0.1/Zend/zend_execute_API.c:391
#4  0x081f0174 in _zval_ptr_dtor_wrapper (zval_ptr=0x8307848) at
/usr/src/php-5.0.1/Zend/zend_variables.c:193
#5  0x081f96c4 in zend_hash_destroy (ht=0x8313e7c) at
/usr/src/php-5.0.1/Zend/zend_hash.c:519
#6  0x0820612e in zend_objects_free_object_storage (object=0x831ac04)
at /usr/src/php-5.0.1/Zend/zend_objects.c:88
#7  0x08208749 in zend_objects_store_free_object_storage
(objects=0x8288664)
    at /usr/src/php-5.0.1/Zend/zend_objects_API.c:72
#8  0x081e418b in shutdown_executor () at
/usr/src/php-5.0.1/Zend/zend_execute_API.c:272
#9  0x081f17c3 in zend_deactivate () at
/usr/src/php-5.0.1/Zend/zend.c:819
#10 0x081aa454 in php_request_shutdown (dummy=0x0) at
/usr/src/php-5.0.1/main/main.c:1212
#11 0x082232b8 in main (argc=2, argv=0xbffff624) at
/usr/src/php-5.0.1/sapi/cli/php_cli.c:1046


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


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

Reply via email to