Edit report at https://bugs.php.net/bug.php?id=62339&edit=1
ID: 62339
User updated by: manchokapitancho at gmail dot com
Reported by: manchokapitancho at gmail dot com
Summary: zend_mm_heap corrupted when trait is autoloaded
after a class that uses it.
-Status: Feedback
+Status: Assigned
Type: Bug
Package: Reproducible crash
Operating System: win 7
PHP Version: 5.4.4
Assigned To: laruence
Block user comment: N
Private report: N
New Comment:
Official snapshots are broken (http://windows.php.net/snapshots/)
Based on https://bugs.php.net/bug.php?id=61712
I've tried to get a snapshot from
http://windows.php.net/downloads/snaps/php-trunk/
But this folder is also empty :)
Looks like I have no way to test it now??
Previous Comments:
------------------------------------------------------------------------
[2012-06-17 05:21:22] [email protected]
this bug is already fixed, but seems the fix is not merged into 5.4.4
http://news.php.net/php.internals/60865
thanks
------------------------------------------------------------------------
[2012-06-17 05:11:55] [email protected]
Please try using this snapshot:
http://snaps.php.net/php-trunk-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
I can not reproduce this in trunk, sorry, could you please try with trunk?
------------------------------------------------------------------------
[2012-06-17 04:12:53] [email protected]
Dmitry, could you please look at this?
thanks
------------------------------------------------------------------------
[2012-06-16 22:06:01] manchokapitancho at gmail dot com
Description:
------------
Bugs #61998 and #62234 seem to be really close to this:
PHP crashes after the script finishes. It echoes "zend_mm_heap corrupted".
Necessary components (ALL required):
1. A class that uses a trait.
2. The trait should contain a method that also exists in the class.
3. This trait method is loaded as an alias in the class.
4. The trait should be in a separate file that is loaded after the file that
contains the class (__autoload)
5. There should be some other code loaded and parsed. The amount of code has
some
randomness but a class with 5000 methods usually works :)
Note: there is a serious randomness in the crash. Sometimes I get it
constantly,
sometimes it crashes when called from apache only and sometimes it may crash
once
and then start working fine.
Test script:
---------------
main.php
---------
function __autoload ($class) {
include 'trait.php';
}
include 'demo.php';
$demo = new demo;
echo $demo->someFunc0();
echo $demo->broken();
trait.php
----------
trait a {
function broken() { return 'broken'; }
}
demo.php
---------
class demo {
use a { broken as private broken_old; }
function broken() { return "OK:" . $this->broken_old(); }
function someFunc0(){return 0;}
... //a small number of method may not trigger that crash.
function someFunc5000(){return 5000;}
}
Expected result:
----------------
OK:broken
Actual result:
--------------
OK:broken
zend_mm_heap corrupted
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62339&edit=1