Phalcon 1.3.x zend_mm_heap corrupted
Hello. Starting from the version of Phalcon 1.3.x we encountered php-fpm errors on the server that happened randomly, on random pages and didn't seem to be logical.
There were such entries in php-fpm logs:
[25-Jun-2014 12:41:53] WARNING: [pool production] child 3033 exited with code 1 after 1770.039968 seconds from start
[25-Jun-2014 12:41:53] WARNING: [pool production] child 3033 said into stderr: "zend_mm_heap corrupted"
[25-Jun-2014 12:39:09] NOTICE: [pool production] child 27071 started
[25-Jun-2014 12:39:09] WARNING: [pool production] child 14483 exited with code 1 after 5006.064858 seconds from start
[25-Jun-2014 12:39:09] WARNING: [pool production] child 14483 said into stderr: "zend_mm_heap corrupted"
[25-Jun-2014 12:38:56] NOTICE: [pool production] child 26871 started
[25-Jun-2014 12:38:56] WARNING: [pool production] child 12402 exited with code 1 after 1027.771509 seconds from start
[25-Jun-2014 12:38:56] WARNING: [pool production] child 12402 said into stderr: "zend_mm_heap corrupted"
[25-Jun-2014 12:38:53] NOTICE: [pool production] child 26823 started
[25-Jun-2014 12:38:53] WARNING: [pool production] child 15005 exited with code 1 after 839.348531 seconds from start
[25-Jun-2014 12:38:53] WARNING: [pool production] child 15005 said into stderr: "zend_mm_heap corrupted"
We couldn't collect any further information about these errors.
First it happened on Debian 6, php 5.4 Then we moved to the server with Debian 7, php 5.5 but the errors were still happening. Downgrade to the Phalcon 1.2.6 solved the problem. We found a similar ticket that almost describes our problem https://github.com/phalcon/cphalcon/issues/2516
Please fix it. Thanks.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
I also have this problem. Any one can help us?
Try to update PHP to 5.5 version
Try to update PHP to 5.5 version
$ php -v PHP 5.5.14-1~dotdeb.1 (cli) (built: Jun 29 2014 22:09:43) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
i have the same issue, php 5.5.xx + phalcon 1.3.2 + ZendOpCache + on OpenSuse 12.3 sometimes this error comes in quick succession.
short extract of apache error log: ... [Tue Jul 15 09:46:46 2014] [warn] client 46.4.109.202Connection reset by peer: mod_fcgid: [Tue Jul 15 09:46:46 2014] [error] [client 46.4.109.202] Premature end of script headers zend_mm_heap corrupted [Tue Jul 15 09:46:47 2014] [warn] client 46.4.109.202Connection reset by peer: mod_fcgid: [Tue Jul 15 09:46:47 2014] [error] [client 46.4.109.202] Premature end of script headers: index.php, zend_mm_heap corrupted [Tue Jul 15 09:46:47 2014] [warn] client 46.4.109.202Connection reset by peer: mod_fcgid: [Tue Jul 15 09:46:47 2014] [error] [client 46.4.109.202] Premature end of script headers: index.php, zend_mm_heap corrupted [Tue Jul 15 09:46:48 2014] [warn] client 46.4.109.202Connection reset by peer: mod_fcgid: [Tue Jul 15 09:46:48 2014] [error] [client 46.4.109.202] Premature end of script headers: index.php, zend_mm_heap corrupted [Tue Jul 15 09:46:49 2014] [warn] client 46.4.109.202Connection reset by peer: mod_fcgid: [Tue Jul 15 09:46:49 2014] [error] [client 46.4.109.202] Premature end of script headers: index.php, zend_mm_heap corrupted [Tue Jul 15 09:46:49 2014] [warn] client 46.4.109.202Connection reset by peer: mod_fcgid: [Tue Jul 15 09:46:49 2014] [error] [client 46.4.109.202] Premature end of script headers: index.php, zend_mm_heap corrupted zend_mm_heap corrupted ... and so on
We have the same problem with apache. Different pages, randomly. Sometimes we catch it on local machine. Php version 5.4.28, phalcon 1.3.2. It started maybe a month ago.
Probably related to #2513, #2239 and #2512 The current workaround is to disable OPcache
Oh yeah, fantastic :rage: Sorry.
@swen100 @cvsguimaraes I found a possible workaround see this article: https://bugs.php.net/bug.php?id=65590
@tmatei Thank you for the link, but I have seen this already some time ago and it sadly has not helped me.
I have the same problem, too, php5.5.12,phalcon1.3.1,nginx1.6.0.
phalcon-1.3.2, php-5.5.14, opcache (7.0.3 and 7.0.4-dev) both same issue
tried it out with newest version 1.3.3 and this issue still exists.
Who can we get in touch with to see if they can fix this issue?
Can someone provide a backtrace?
git clone http://github.com/phalcon/cphalcon
git checkout 1.3.3
cd cphalcon/ext
sudo ./install
cd /path/to/website/public
gdb php
(gdb) run index.php
(gdb) bt full
this bug is very very annoying, but not easy reproducable. We have several hundred requests per minute and sometimes it occurs, but we can not figure out at which point or which request it happened... we will not upgrade phalcon to 1.3.x until this bug is fixed. So, please, is there anybody who can give us a backtrace?
@phalcon The problem is that I don't think its reproducible from the command line. For my issues I was able to resolve this by turning off the opcache.fast_shutdown, but it was stated by @swen100 that did not fix his problem. One thing that I know for a fact is that the code was working fine in 1.2.x versions and something was introduced in 1.3.x branch since the very first version. To me it seems like something gets cached in opcache and its there for the next page request, which ends up crashing php. Is there another way to debug this?
Same issue here. I solved the problem by disabling opcache, restarting apache and re-enabling opcache.
Hi, how did you re-activate opcache without restarting apache?
It's correct, i restart apache again after re-enabling opcache :)
We used jmeter to try to test this out, and very inconsistent. There was no way to repeat the problem. Out of say 1000 connections we would get only a small X number of failures. After over a month of this we finally had to downgrade.