Edit report at https://bugs.php.net/bug.php?id=62234&edit=1
ID: 62234
User updated by: manchokapitancho at gmail dot com
Reported by: manchokapitancho at gmail dot com
Summary: PHP crashes if a trait + alias is used.
-Status: Assigned
+Status: Open
Type: Bug
Package: Reproducible crash
Operating System: win 7
PHP Version: 5.4.5-dev
Block user comment: N
Private report: N
New Comment:
Reopening...
Previous Comments:
------------------------------------------------------------------------
[2012-06-06 06:31:48] manchokapitancho at gmail dot com
Sorry, my fault. The bug is still there. If I don't have aliases, everything is
fine. But once I uncomment one, the error is back.
Tried 5.5.0-dev and 5.4.5-dev.
class XXX {
use \logi\tile\html\feature { getTemplateNames as getTemplateNamesBase; }
protected function getTemplateNames() {
$tpls = (array)$this->getTemplateNamesBase();
array_push ($tpls, "/listing\\template");
array_push ($tpls, "admin\\listing\\template");
return $tpls;
}
}
It is worth mentioning that the trait is autoloaded.
------------------------------------------------------------------------
[2012-06-06 06:06:54] manchokapitancho at gmail dot com
My bug seems to be a duplicate of this one.
https://bugs.php.net/bug.php?id=61998
I had 3 occurrences of use X as Y. After removing them, there were no more
crashes.
I tried the latest snapshot and I have no more problems with the original code.
------------------------------------------------------------------------
[2012-06-06 05:54:02] manchokapitancho at gmail dot com
Reproduced in CLI mode. Ran the same code and simulated some $_SERVER values. I
get 1:1 result so it is not Apache related. The message I get at the end of the
script is: zend_mm_heap corrupted.
------------------------------------------------------------------------
[2012-06-05 16:00:33] manchokapitancho at gmail dot com
Description:
------------
I am using Apache 2.2 + PHP 5.4.
After several crash situations (from apache log "Parent: child process exited
with status 1 -- Restarting."), I've managed to isolate a problem. Since I
don't
know what it is exactly, here I list the symptoms:
1. It's not related to a specific code fragment. I am able to reproduce the
crash by adding different code in different files.
2. Too much code leads to a crash. If I have a working code and I add for
example 30 more functions to a class, I get a crash.
3. Adding more data does not affect the situation. By data I mean actions like
changing $a = [1,2,3] to $a=[1,2,3, ....1000].
4. The entire script is executed till the end and then the crash happens. I
asume this happen when the cleanup routines are executed.
5. The crashes are not memory related. I saw cases when the crash happens at
around 612K and others when the script run ok at around 619K.
6. I've tested with xdebug on and off. No significant difference is present. If
I don't have xdebug active, I need a few more empty functions into the code in
order to reproduce the crash.
Here I've put some interesting observations that I've had.
http://crop-factor.net/php54crash.png
phpinfo says:
System Windows NT 6.1 build 7600 (Windows 7 Enterprise Edition) i586
Build Date May 8 2012 00:47:34
Compiler MSVC9 (Visual C++ 2008)
Architecture x86
Configure Command cscript /nologo configure.js "--enable-snapshot-build"
"--disable-isapi" "--enable-debug-pack" "--without-mssql" "--without-pdo-mssql"
"--without-pi3web"
"--with-pdo-oci=C:\php-sdk\oracle\instantclient10\sdk,shared"
"--with-oci8=C:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-
11g=C:\php-sdk\oracle\instantclient11\sdk,shared" "--enable-object-out-
dir=../obj/" "--enable-com-dotnet" "--with-mcrypt=static" "--disable-static-
analyze" "--with-pgo"
Server API Apache 2.0 Handler
PHP API 20100412
PHP Extension 20100525
Zend Extension 220100525
Zend Extension Build API220100525,TS,VC9
PHP Extension Build API20100525,TS,VC9
Debug Build no
Thread Safety enabled
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62234&edit=1