Edit report at https://bugs.php.net/bug.php?id=40479&edit=1
ID: 40479 Comment by: andreyvit at me dot com Reported by: rrossi at maggioli dot it Summary: zend_mm_heap corrupted Status: Feedback Type: Bug Package: Reproducible crash Operating System: Suse Linux 9.0 PHP Version: 5.2.1 Block user comment: N Private report: N New Comment: Just had the same issue, but 100% reproducible. It does not always print zend_mm_heap corrupted, but it always segfaults PHP. I've traced it to an equivalent of the following two lines of code: $xx = new stdClass; strpos($xx, ':'); Moreover, this only crashes inside a custom error handler function. If I disable set_error_handler call, the crash disappears. The crash inside the error handler is on a pretty innocent operation, and the location is not stable (most often it crashes on assigning a large literal array to a static variable). I tried to produce a smaller test case which reproduces the crash, but failed. Some magic dust is always missing. However, this gives us an alternative theory why most people may only be seeing this in production and rarely: they may only be running a custom error handler in production, and they may have a rare critical error somewhere which can trigger it. Try disabling your error handler and see. Previous Comments: ------------------------------------------------------------------------ [2011-12-11 19:37:37] arekm at maven dot pl "f dot ardelian at gmail dot com" test case works on php 5.4rc2, too (php cli segfaults) ------------------------------------------------------------------------ [2011-11-23 11:30:36] utnalove at yahoo dot it Hello, I use Wordpress. I am hosted in home.pl which uses IdeaWebServer instead of Apache. Very often when I enable whatever cache plugin I get the "zend_mm_heap corrupted" error. I have also a hosting in the USA with Apache and the same PHP and MySql versions. If I backup both data and database and restore it in the Apache server I can use my caching plugins without issues because the "zend_mm_heap corrupted" error never appears. Home.pl says that this is a PHP issue and it is not connected with their non- Apache server. What's your opinion in that? Is it a PHP issue or a hosting issue? Thank you ------------------------------------------------------------------------ [2011-11-02 10:34:30] from dot php dot net at brainbox dot cz I can reproduce the bug on Microsoft Windows XP SP3, with latest official PHP 5.3.8 NTS build. When we run script from "f dot ardelian at gmail dot com", PHP does not output "zend_mm_heap corrupted", but right after displaying the "If you see thisâ¦" line CRASHES. However, I found that when I call "gc_disable();" before script end, it finishes successfully. This helped me run the test script without problems, but didn't solve the issue in my other scripts. <? define('OBJECT_COUNT', 100 * 1000 * 10); class Object { private static $world = array(); private static $maxGuid = 0; protected $_guid = null; public function __construct() { self::$world[$this->_guid = self::$maxGuid++] = $this; } public function __destruct() { unset(self::$world[$this->_guid]); } } for ($i = 0; $i < OBJECT_COUNT; ++$i) { new Object(); } // You probably won't see this because of the "zend_mm_heap corrupted" echo 'If you see this, try to increase OBJECT_COUNT to 100,000'; gc_disable(); // ADDED - works for me - PHP does not crash ?> ------------------------------------------------------------------------ [2011-10-17 20:24:44] rob dot spekschoor at gmail dot com problem solved by compiling apache with prefork. Somehow Apache worker MPM + PHP 5.2 works fine but Apache worker MPM + PHP 5.3 fails terribly. Prefork seems stable ------------------------------------------------------------------------ [2011-10-05 20:08:42] rob dot spekschoor at gmail dot com I can also reproduce with script from 'f dot ardelian at gmail dot com' this error on: php --version PHP 5.3.8-pl0-gentoo (cli) (built: Oct 4 2011 10:42:38) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=40479 -- Edit this bug report at https://bugs.php.net/bug.php?id=40479&edit=1