PHP :: Bug #60558 :: Invalid read and writes

Bug #60558 Invalid read and writes
Submitted: 2011-12-19 04:05 UTC Modified: 2011-12-19 16:49 UTC
From: laruence@php.net Assigned: laruence (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.4.0RC3 OS:
Private report: No CVE-ID: None

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2011-12-19 04:53 UTC] laruence@php.net

Gron, ignore the assigment, I just want to get your attention, so let's diag this 
one again :) thanks

 [2011-12-19 08:55 UTC] laruence@php.net

seems something wrong with the refcount of zval in traits's 
default_properties_table[i].  

but I have not figured out what's going wrong. 

A more simple test:
<?php

trait A {
   private $hello = 0;
}

class BaseWithTPropB{
        use A;
}

class SubclassB extends BaseWithTPropB {
        use A;
}

$b = new SubClassB;
var_dump($b);
?>

plz run valgrind like:
USE_ZEND_ALLOC=0  valgrind --db-attach=yes --leak-check=full php test.php

 [2011-12-19 10:07 UTC] laruence@php.net

-Status: Open +Status: Closed -Assigned To: +Assigned To: laruence

 [2011-12-19 10:07 UTC] laruence@php.net

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.

ah, worked out, fixed :) thanks

 [2011-12-19 12:00 UTC] laruence@php.net

didn't fixed, introduced new memory leak.

 [2011-12-19 12:46 UTC] laruence@php.net

-Assigned To: laruence +Assigned To: gron

 [2011-12-19 12:46 UTC] laruence@php.net

There must be something difference between traits and class while doing 
inheritance, but I can't figure out,

gron, plz look at this... my previous attempt failed.

 [2011-12-19 13:20 UTC] gron@php.net

Ideally, it should not be different :-/
Will try to find time soon.

Thanks
Stefan

 [2011-12-19 16:49 UTC] laruence@php.net

-Status: Re-Opened +Status: Closed -Assigned To: +Assigned To: laruence