Bug #51420 [Fbk->Opn]: Silent crash when memory usage >= 4MByte
Edit report at http://bugs.php.net/bug.php?id=51420&edit=1
ID: 51420
User updated by: pst at telia dot com
Reported by: pst at telia dot com
Summary: Silent crash when memory usage >= 4MByte
-Status: Feedback
+Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: Windows Server 2003 SP2
PHP Version: 5.3.2
New Comment:
The problem is that the original script accesses a huge Oracle 11G
database and uses COM automation that in turn gets data from a different
kind of server on the network. So there is simply no way you could run
the same script I do.
But I'll try and see if I can make a simpler script to reproduce the
error.
Right now I'm installing 5.2.13 to see if it behaves the same way.
Previous Comments:
------------------------------------------------------------------------
[2010-03-29 01:40:39] pajoye@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-29 01:32:07] pst at telia dot com
The script is just a snippet of the entire script. Unfortunately I can't
provide the entire script and include files.
I use 5.3.2 CLI (php.exe) but I used 5.3.0 before and it crashes too.
If I call the script from inside the webserver (PHP5.3.2 & apache
2.2.15) I still get the same crash.
My wild guess is that there is some kind of problem inside the memory
allocation as the crash is just when a new block (256kB) is about to be
allocated.
It is likely related to something else being allocated as well because I
can't reproduce that crash by just using the little code snippet above.
------------------------------------------------------------------------
[2010-03-29 01:04:01] pajoye@php.net
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?
------------------------------------------------------------------------
[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
Thread (8 messages)