Edit report at https://bugs.php.net/bug.php?id=62907&edit=1
ID: 62907 Updated by: dmi...@php.net Reported by: larue...@php.net Summary: Double free when use traits -Status: Assigned +Status: Closed Type: Bug Package: Scripting Engine problem PHP Version: 5.4.6 Assigned To: dmitry Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2012-09-05 06:02:15] dmi...@php.net Automatic comment on behalf of dmi...@zend.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=6c0508f8d5d5a62adb37a76bc682c94540199ee3 Log: Fixed bug #62907 (Double free when use traits) ------------------------------------------------------------------------ [2012-09-04 08:12:31] dmi...@php.net The following patch has been added/updated: Patch Name: alias.diff Revision: 1346746351 URL: https://bugs.php.net/patch-display.php?bug=62907&patch=alias.diff&revision=1346746351 ------------------------------------------------------------------------ [2012-08-26 10:33:08] larue...@php.net 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 ------------------------------------------------------------------------ [2012-08-23 15:32:28] larue...@php.net assign to my self. ------------------------------------------------------------------------ [2012-08-23 15:31:43] larue...@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