zend_mm_heap corrupted

Support/Development for PHP
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

zend_mm_heap corrupted

Unread post 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.
Lemonbit Internet Dedicated Server Management
BruceLee
Forum Regular
Forum Regular
Posts: 879
Joined: Sat Mar 28, 2009 6:58 pm
Location: Germany

Re: zend_mm_heap corrupted

Unread post 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
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: zend_mm_heap corrupted

Unread post 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.
Lemonbit Internet Dedicated Server Management
BruceLee
Forum Regular
Forum Regular
Posts: 879
Joined: Sat Mar 28, 2009 6:58 pm
Location: Germany

Re: zend_mm_heap corrupted

Unread post 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?
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: zend_mm_heap corrupted

Unread post 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.
Lemonbit Internet Dedicated Server Management
BruceLee
Forum Regular
Forum Regular
Posts: 879
Joined: Sat Mar 28, 2009 6:58 pm
Location: Germany

Re: zend_mm_heap corrupted

Unread post 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.
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: zend_mm_heap corrupted

Unread post 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.
Lemonbit Internet Dedicated Server Management
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: zend_mm_heap corrupted

Unread post by breun »

Hm, that wasn't it. Just got another 'zend_mm_heap corrupted' in /var/log/httpd/error_log. :(
Lemonbit Internet Dedicated Server Management
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: zend_mm_heap corrupted

Unread post 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?
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
gaia
Forum Regular
Forum Regular
Posts: 213
Joined: Tue Jun 09, 2009 12:57 pm

Re: zend_mm_heap corrupted

Unread post by gaia »

Do you have mod_pagespeed installed? I noticed this happens on my machine only when it's ON.
CentOS 6.9
ASL 4.0.19-37
prupert
Forum Regular
Forum Regular
Posts: 573
Joined: Tue Aug 01, 2006 2:45 pm
Location: Netherlands

Re: zend_mm_heap corrupted

Unread post 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.
Lemonbit Internet Dedicated Server Management
Post Reply