Edit report at http://bugs.php.net/bug.php?id=51182&edit=1
ID: 51182 Updated by: j...@php.net Reported by: torsten dot landmann at bauermedia dot com Summary: PHP crashes: "zend_mm_heap corrupted" after array operation -Status: Open +Status: Feedback Type: Bug Package: Reproducible crash Operating System: Ubuntu PHP Version: 5.2.13 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Previous Comments: ------------------------------------------------------------------------ [2010-03-02 18:16:24] j...@php.net Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2010-03-02 12:31:00] torsten dot landmann at bauermedia dot com Description: ------------ We have a reproducible crash scenario but there are two problems with that: 1. PHP doesn't crash EVERY time. 2. We didn't manage to reproduce the problem with a simple script yet. It only happens in our Drupal-driven website with about 3000 files and a complex database. However we managed to isolate the problem to a single line in code, which, if it gets rewritten, fixes the problem. Because this line actually is a little weird and not good programming style anyways, it seems plausible to us that you will be able to comprehend the problem in PHP sourcecode if you look into it directly. This is what happens if PHP crashes in our scenario: 1. The page gets completely rendered and output is written to the output stream. 2. Shutdown functions are executed. 3. After executing the last statement of the last shutdown function PHP suddenly crashes. The output buffer is discarded. The visitor sees blank page. The Apache error log receives a line that reads "zend_mm_heap corrupted" The following is the line of code that seems to cause the problem. This line of code is executed long before any output data is written and long before shutdown functions get executed. It doesn't crash directly but only seems to trigger a future crash: $tax = current(taxonomy_node_get_terms($node)); ($node is an instance of stdClass, taxonomy_node_get_terms() returns an array.) It seems that PHP may choke on its memory management later on when this line has been executed before. Maybe there's a problem because the return value is used for writing although not being saved in a variable. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=51182&edit=1