Bug #51420 [Opn->Fbk]: Silent crash when memory usage >= 4MByte

[email protected] Mon, 29 Mar 2010 01:04:02 +0200 (CEST)
Newsgroups php.bugs
Message-ID <[email protected]>
Edit report at http://bugs.php.net/bug.php?id=51420&edit=1

 ID:               51420
 Updated by:       [email protected]
 Reported by:      pst at telia dot com
 Summary:          Silent crash when memory usage >= 4MByte
-Status:           Open
+Status:           Feedback
 Type:             Bug
 Package:          Scripting Engine problem
 Operating System: Windows Server 2003 SP2
 PHP Version:      5.3.2

 New Comment:

I can't reproduce the crash, this script works just fine.

Do you use 5.3.2 or 5.3? Using CLI or inside a webserver?


Previous Comments:
------------------------------------------------------------------------
[2010-03-29 00:43:59] pst at telia dot com

Description:
------------
Hi,

I get a silent crash when I add data to an array. I access a com object
and an oracle database in the script but not while it crashes.

memory_get_usage(true) shows 3932160 bytes before script crashes.

Windows Task Manager shows php.exe mem usage building up to a maximum of
around 42,100 K when it crashes.

phpinfo() shows memory_limit => 256M => 256M

I use php.exe (VC6 thread safe) but get the same crash using php-win.exe
or via apache 2.2 module.

The script crashes on 5.3.0 as well but works on an older system using
php 4.3.4 & Windows Server 2000 SP4.



Test script:
---------------
Can't provide entire script and include files but this is what I do when
it crashes:

         for ($i=0;$i<20000;$i++) {
            print "$i ";
            $arr[$i][0]='2010-03-29 00:00:'+$i%100;
            $arr[$i][1]=rand(1,100);
            print memory_get_usage(true);
            print "\r\n";
            usleep(10);
         }
         print "ok";



Expected result:
----------------
I expect the script to loop 20000 times and finish by writing "ok".


Actual result:
--------------
End of the output is:

9990 3932160
9991 3932160
9992 3932160
9993 3932160
9994 

So it crashes on one of the lines where array data is added.



Backtrace:

Thread 0 - System ID 5760
Entry point   php+2d78 
Create time   3/29/2010 12:23:21 AM 
Time spent in user mode   0 Days 0:0:0.15 
Time spent in kernel mode   0 Days 0:0:0.93 


Function     Arg 1     Arg 2     Arg 3   Source 
php5ts!zobj_mark_grey+51     01b42eac     00c0fb14     00222718    
php5ts!gc_mark_roots+76     00222718     00222718     01c6ac18    
php5ts!gc_collect_cycles+64     00222718     057c820c     01b80e78    
php5ts!gc_zval_possible_root+df     057c8190     00222718     00000000  
 
php5ts!ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER+72     00c0fc0c    
00222718     00c0fea8    
php5ts!execute+2fe     01b80e78     00222700     00000000    
php5ts!zend_execute_scripts+f6     00000008     00222718     00000000   

php5ts!php_execute_script+245     00c0fea8     00222718     00000000   

php+1ec1     00000002     00223fc8     00222ba8    
php+2e5b     00000000     00000000     7ffdb000    
kernel32!ProcessIdToSessionId+209     00402d78     00000000     00000000
   




PHP5TS!ZOBJ_MARK_GREY+51In
php__PID__6396__Date__03_29_2010__Time_12_25_58AM__869__Second_Chance_Exception_C0000005.dmp
the assembly instruction at php5ts!zobj_mark_grey+51 in C:\Program
Files\PHP\php5ts.dll from The PHP Group has caused an access violation
exception (0xC0000005) when trying to read from memory location
0x00000014 on thread 0




------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51420&edit=1