From:             
Operating system: Linux Ubuntu 10.0.0.4
PHP version:      5.3.2
Package:          Reproducible crash
Bug Type:         Bug
Bug description:zend_mm_heap corrupted at end of program

Description:
------------
I'm posting as a crash, even though the program completes its work before
segfaulting.



I have a large, complex PHP command-line program that uses PHPExcel to read
spreadsheet files, builds large data arrays, then uses XML_Serializer to
generate XML, and writes the XML to a file.  The main program is primarily
a sequential class loader, that reads in about 40 class files.  It also
uses getopt() to parse command line options.  Maximum memory use is around
300-400 megabytes.



This program works fine.  However, under certain circumstances (including
my 'verbose' logging output option, which generates 60,000 lines of log
data), the program completes its work but after the final line of output,
it says 'zend_mm_heap corrupted'.



Whether this occurs depends on the input spreadsheet, and is not directly
related to the size of the sheet or the size of the output XML, or the
maximum memory used. 



I have found that, for the spreadsheet that generates the error, by
changing one array element in the default command line option definitions,
I can turn the error on and off.



If I run the program as 'php my_program.php -blah', it acts the same as if
I run it directly as 'my_program.php -blah'.  However, if I run the program
as 'php -e my_program.php -blah' I never get the zend message.



I have run this under gdb using php -e to get a stack.  Under gdb it
segfaults for both versions of the program.  The stack is identical for
both versions of the program and the zend_mm_heap message does not appear.



Here the is the gdb stack.  (The first line is the ending line of my
program.)



Program ending with status 0x0, 0 warnings and 0 errors



Program received signal SIGSEGV, Segmentation fault.

0x00000000006b549f in ?? ()

(gdb) bt

#0  0x00000000006b549f in ?? ()

#1  0x00000000006b59fb in ?? ()

#2  0x00000000006a1e4e in zend_hash_destroy ()

#3  0x0000000000694e2f in _zval_dtor_func ()

#4  0x0000000000688e5d in _zval_ptr_dtor ()

#5  0x00000000006a1e28 in zend_hash_destroy ()

#6  0x00000000006b6d69 in zend_object_std_dtor ()

#7  0x00000000006b6d89 in zend_objects_free_object_storage ()

#8  0x00000000006ba27c in zend_objects_store_free_object_storage ()

#9  0x0000000000689255 in ?? ()

#10 0x0000000000695b72 in ?? ()

#11 0x0000000000641825 in php_request_shutdown ()

#12 0x0000000000725314 in ?? ()

#13 0x00007ffff52a7c4d in __libc_start_main (main=<value optimized out>, 

    argc=<value optimized out>, ubp_av=<value optimized out>, 

    init=<value optimized out>, fini=<value optimized out>, 

    rtld_fini=<value optimized out>, stack_end=0x7fffffffe218)

    at libc-start.c:226

#14 0x000000000042c639 in _start ()





Unfortunately, I can not post the code or the data.  It's large, and it's
confidential, and the problem has appeared and disappeared with minor code
changes over the last week so I don't think I can reduce it.  However if
anyone has any ideas, I'd be willing to help as much as I can.



Loaded modules: core mod_log_config mod_logio prefork http_core mod_so
mod_alias mod_auth_basic mod_authn_file mod_authz_default
mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi
mod_deflate mod_dir mod_env mod_mime mod_negotiation mod_php5 mod_python
mod_reqtimeout mod_setenvif mod_ssl mod_status mod_userdir 

Expected result:
----------------
I don't expect to see 'zend_mm_heap corrupted'


-- 
Edit bug report at http://bugs.php.net/bug.php?id=52038&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=52038&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=52038&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=52038&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=52038&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52038&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=52038&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=52038&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=52038&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=52038&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=52038&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=52038&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=52038&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=52038&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=52038&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52038&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52038&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=52038&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=52038&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=52038&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=52038&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=52038&r=mysqlcfg

Reply via email to