Bug #40479 [Com]: zend_mm_heap corrupted
| From: | komanek at natur dot cuni dot cz | Date: | Wed, 28 Mar 2012 09:31:57 +0000 |
| Subject: | Bug #40479 [Com]: zend_mm_heap corrupted | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-168913@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=40479&edit=1
ID: 40479
Comment by: komanek at natur dot cuni dot cz
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:
I have just run into the same problems after upgrading from 5.2.17
to 5.3.10 last weekend. Hosted on Debian server. Before I found this
bug report, I created another one:
https://bugs.php.net/bug.php?id=61508
, which now seems to be a duplicate of this one.
It is true I have a loaded server with many extensions and many
users with their own apps, so this seems not to be possible for me
to check all their code or to downgrade to unsupported 5.2 branch.
Previous Comments:
------------------------------------------------------------------------
[2012-02-20 20:05:16] andreyvit at me dot com
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.
------------------------------------------------------------------------
[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
------------------------------------------------------------------------
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