Bug #62907 [Asn]: Double free when use traits

From: Date: Sun, 26 Aug 2012 10:33:08 +0000
Subject: Bug #62907 [Asn]: Double free when use traits
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-172917@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62907&edit=1 ID: 62907 Updated by: laruence@php.net Reported by: laruence@php.net Summary: Double free when use traits Status: Assigned Type: Bug Package: Scripting Engine problem PHP Version: 5.4.6 -Assigned To: laruence +Assigned To: dmitry Block user comment: N Private report: N New Comment: Unless we re-implement the whole alias thing, drop the tricky. we could not fix this properly, even we can do some works in the abstrct methods copy, but it still in a wrong way. Dmitry, could you please look at this? thanks Previous Comments: ------------------------------------------------------------------------ [2012-08-23 15:32:28] laruence@php.net assign to my self. ------------------------------------------------------------------------ [2012-08-23 15:31:43] laruence@php.net Description: ------------ This bug is related to #61998, but was spotting when I fixing the bug #62358, PS: it really tough to refine this reproduce script :) Test script: --------------- <?php function __autoload($name) { if ($name == "B") { eval ("abstract class B extends A { }"); } else if ($name == "A") { eval ("abstract class A { use T { T::__construct as __asconstruct; }}"); } else if ($name == "T") { eval ("trait T { public function __construct() { } }"); } return TRUE; } class C extends B { public function __construct() { } } Expected result: ---------------- no error Actual result: -------------- [Thu Aug 23 23:34:22 2012] Script: '/home/huixinchen/bug_double_free.phpt' --------------------------------------- /home/huixinchen/opensource/trunk/Zend/zend_opcode.c(392) : Block 0x2b2c499c8820 status: Beginning: Cached Freed (invalid) Start: OK End: OK --------------------------------------- [Thu Aug 23 23:34:22 2012] Script: '/home/huixinchen/bug_double_free.phpt' Zend/zend_language_scanner.l(1903) : Freeing 0x2B2C499C4AA0 (12 bytes), script=/home/huixinchen/bug_double_free.phpt === Total 1 memory leaks detected === ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62907&edit=1

« previous php.bugs (#172917) next »