From: Operating system: Redhat Linux - Kernel 2.6.18 PHP version: 5.4.3 Package: Reproducible crash Bug Type: Bug Bug description:Using traits with method aliases appears to result in crash during execution.
Description: ------------ During testing in out application under development we began experiencing crashes in the PHP module with an error indicating "zend_mm_heap corrupted." As this was occurring in a larger application, we noticed it did not begin occurring until we include method aliases in a trait we'd written. We loaded a debug build of PHP 5.4.3 and observed the following error message: [Thu May 10 10:46:13 2012] Script: '/home/xxxxxxx/public_html/www/app/portal.rvlx' --------------------------------------- /opt/src/apache2.2/php-5.4.3/Zend/zend_opcode.c(235) : Block 0x09ef4914 status: Invalid pointer: ((size=0x00000038) != (next.prev=0x00000420)) --------------------------------------- We then developed a small sandbox test which included a simple script with a trait with method a alias. This did not yield the same error message, but it did indicate a failure with the same line of code, zend_opcode.c:235. It also referenced another file with a different error: [Thu May 10 11:16:36 2012] Script: '/home/xxxxxxx/public_html/www/sites/traitBug/trait_bug_test.php' Zend/zend_language_scanner.l(1889) : Freeing 0xB7EFAFD4 (12 bytes), script=/home/crussell/public_html/www/sites/traitBug/trait_bug_test.php === Total 1 memory leaks detected === [Thu May 10 11:16:36 2012] Script: '/home/xxxxxxx/public_html/www/sites/traitBug/trait_bug_test.php' --------------------------------------- /opt/src/apache2.2/php-5.4.3/Zend/zend_opcode.c(235) : Block 0xb7ef87d4 status: Beginning: Cached Freed (invalid) Start: OK End: OK --------------------------------------- Two adjustments to the scripts would clear this error. Either eliminating the use of the autoloader and performing a "require_once" statement in the code, or eliminating the method alias. Either of those 2 actions eliminates this error from our logs. Both trait method aliasing and autoloader functionality are vital to our application, so we're eager to see this issue resolved. When executed in our application, this error results in immediate closure of the apache connection and a zero length response. Test script: --------------- I do not have a test script, but I do have a zip file with a directory containing the trait files and executable PHP code to replicate this issue. Please contact me at my email address rbarb...@revelex.com, when the bug has been assigned and I will send you the archive with test scripts. Expected result: ---------------- Expectation is that the script would execute without any errors in the apache logs. Actual result: -------------- See the bug description. -- Edit bug report at https://bugs.php.net/bug.php?id=61998&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61998&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61998&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61998&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61998&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61998&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61998&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61998&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61998&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61998&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61998&r=support Expected behavior: https://bugs.php.net/fix.php?id=61998&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61998&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61998&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61998&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61998&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=61998&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61998&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61998&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61998&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61998&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61998&r=mysqlcfg