Page 1 of 1

zend_mm_heap corrupted

Posted: Sat Mar 13, 2010 7:58 pm
by breun
I just noticed that on one server /var/log/httpd/error_log has a lot of 'zend_mm_heap corrupted' entries. OSSEC apparently doesn't pick these up. Pages load normally though. Is there a problem to solve here?

Installed PHP packages:

Code: Select all

# rpm -qa | grep ^php | sort
php-5.2.13-1.el4.art
php-cli-5.2.13-1.el4.art
php-common-5.2.13-1.el4.art
php-devel-5.2.13-1.el4.art
php-gd-5.2.13-1.el4.art
php-imap-5.2.13-1.el4.art
php-ioncube-loader-3.3.11-1.el4.art
php-ldap-5.2.13-1.el4.art
php-mbstring-5.2.13-1.el4.art
php-mysql-5.2.13-1.el4.art
php-pdo-5.2.13-1.el4.art
php-pear-1.7.2-2.el4.art
php-xml-5.2.13-1.el4.art
Don't know if this is related, but this is also the one server where installing php-eaccelerator causes Apache to segfault, while it works fine on all of our other servers.

Re: zend_mm_heap corrupted

Posted: Mon Mar 15, 2010 5:26 am
by BruceLee
It seems like a code related error to me that mostly happens in heavy code.
I have searched a little bit.
Maybe you can try this to near it down:

Code: Select all

edit /usr/local/apache2/bin/apachectl

and add:
export USE_ZEND_ALLOC=0

and stop & start apache.
or try to change one of these variables in php.ini. best would be on the domain that is causing the crash.
I assume to the other post that you are using suPHP.

Code: Select all

variables_order
  - Not OK: EGPCS
  - OK: GPCS
register_long_arrays
  - Not OK: On
  - OK: Off
magic_quotes_gpc
  - Not OK: On
  - OK: Off

Re: zend_mm_heap corrupted

Posted: Mon Mar 15, 2010 5:39 am
by breun
BruceLee wrote:It seems like a code related error to me that mostly happens in heavy code.
I have searched a little bit.
Maybe you can try this to near it down:

Code: Select all

edit /usr/local/apache2/bin/apachectl

and add:
export USE_ZEND_ALLOC=0

and stop & start apache.
(That would be /usr/sbin/apachectl on CentOS.) I just googled USE_ZEND_ALLOC and read it doesn't do much when using mod_php.
or try to change one of these variables in php.ini. best would be on the domain that is causing the crash.
The 'zend_mm_heap corrupted' messages appear in the global /var/log/httpd/error_log, so not in a specific domain's error_log.
I assume to the other post that you are using suPHP.
No, this is just plain old mod_php.

Code: Select all

variables_order
  - Not OK: EGPCS
  - OK: GPCS
EGPCS is the default. Why do you recommend not registering environment variables?

Code: Select all

register_long_arrays
  - Not OK: On
  - OK: Off
magic_quotes_gpc
  - Not OK: On
  - OK: Off
These settings are both set to off.

Re: zend_mm_heap corrupted

Posted: Mon Mar 15, 2010 6:03 am
by BruceLee
those where just options to isolate the problem.
After reading your answers it seems not so easy to near down.
Do these errors show up constantly or only during day or night time?

Re: zend_mm_heap corrupted

Posted: Mon Mar 15, 2010 6:21 am
by breun
I'm not sure as there are no timestamps with the 'zend_mm_heap corrupted' messages. I also noticed Apache segfaults ~20 times a day (no eAccelerator installed). I also noticed a bunch of apache owned semaphores hanging around after stopping Apache. I cleaned those up, let's see if that makes a difference.

Re: zend_mm_heap corrupted

Posted: Mon Mar 15, 2010 6:39 am
by BruceLee
It could be Horde related. If a user access horde webmail interface and want to read/open bigger emails.
Do you have users leaving there mail on the server and using horde?
Maybe you can create a dummy mail account and put some big messages(with big embedded pictures e.g.) in an extra created imap folder other than inbox
and then try out horde. After reading a few messages the error could show up.

this case seems pretty tricky. maybe you could gdb the whole processes to near it down.

Re: zend_mm_heap corrupted

Posted: Mon Mar 15, 2010 6:43 am
by breun
Trying to open e-mails with large attachments result in out of memory errors when PHP's memory_limit is reached. I know those, but those are nice clean error messages, with timestamps and references to Horde and everything.

Thanks for the help though.

Re: zend_mm_heap corrupted

Posted: Mon Mar 15, 2010 7:08 am
by breun
Hm, that wasn't it. Just got another 'zend_mm_heap corrupted' in /var/log/httpd/error_log. :(

Re: zend_mm_heap corrupted

Posted: Mon Mar 15, 2010 8:11 am
by faris
When it comes to the mod_sec-related segfaults, I find that NOT cleaning up the semaphores helps.

i.e. get segfaults, see semaphores increase slightly, restart apache (service httpd restart) without cleaning semaphores = no more segfaults. In contrast, cleaning the semaphores quite often results in segfaults again.

This isn't mod_sec related, and not segfault-related either, but I thought I'd mention it anyway!

Have you run a memory check/checked hardware log for any bit errors? Just in case?

Re: zend_mm_heap corrupted

Posted: Fri Nov 21, 2014 12:50 pm
by gaia
Do you have mod_pagespeed installed? I noticed this happens on my machine only when it's ON.

Re: zend_mm_heap corrupted

Posted: Fri Nov 21, 2014 1:25 pm
by prupert
gaia wrote:Do you have mod_pagespeed installed? I noticed this happens on my machine only when it's ON.
This thread was started more than four years ago! ;-) AFAIK mod_pagespeed was not involved.