php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29086 PHP 5.0 crash on long php scripts
Submitted: 2004-07-10 15:48 UTC Modified: 2004-07-12 19:47 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: gunnar at greyhound-data dot com Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5.0.0RC3 OS: MorphOS, Windows, Linux
Private report: No CVE-ID: None
 [2004-07-10 15:48 UTC] gunnar at greyhound-data dot com
Description:
------------
PHP crashes on long source scripts.


I use Apache(1.3.31) and PHP 5.0.0rc3 on MorphOS.

I noticed that all long scripts (over 1200 lines)
will crash the Apache/PHP build.

Script with 1000 or less lines run fine in less than
a second, as soon as I add a few hundred more lines PHP 
will die.

The amount of compiled lines of code is the limiting 
factor. A script with 3000 lines of code and 2000 
commented out lines runs fine.
But the same script with just 1200 lines of code (none 
of them commented out) dies.


It looks like a memory problem but my machine has still 
more than 250 MB free... The php memory limit (in 
php.ini) is set to 20MB.




Mr Bert Slagter reproduced the crash on Linux and 
Windows.

He said that:
The same problem exists here, though on a significant 
higher linecount.

Tried it on WinXP, Apache 1.3.29 with PHP 5.0.0-dev 
(built: Jul-2-2004).
With 17.000 lines everything is fine. With 18.000 of the 
above lines apache crashes. Verified it by adding and 
deleting 1.000 lines a few times.

Tried it on Linux, CLI PHP 5.0.0-dev (build: Jul-8
-2004). Here it segfaults exactly on 34517 lines. One 
line less, no problem. Reproducable.

Running under the Zend Debugger Apache doesn't crash.


I hope this report will help you to find and fix the 
problem. If you have any ideas how I extend the number 
of lines which PHP is able to compile on MorphOS, then 
please tell me.

Kind regards

Gunnar

Reproduce code:
---------------
Any code which is long enough will crash PHP

I verified this with a very simple test script

<?
$i++
print "$i<br>";
$i++
print "$i<br>";
...[1000 more lines like the above]..
?>

Actual result:
--------------
PHP crashes.

PHP on MorphOS will crash on scripts longer than 1500 
lines.

PHP on WinXP will crash an script longer 18,000 lines.
Tried it on WinXP, Apache 1.3.29 with PHP 5.0.0-dev 
(built: Jul-2-2004).

On linux PHP will crash an scripts longer than 35,000 
lines.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-12 19:47 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 23:01:33 2025 UTC