PHP 5.0 crash on long php script with over 1000 lines

php.internals

Gunnar von Boehn

22 years ago
Hi, I have a very special PHP problem. I use Apache(1.3.31) and PHP 5.0.0rc3 on MorphOS. Normally this PHP and Apache build runs fine. I noticed that all long scripts (over 1000 lines) will kill the Apache/PHP build. I verified this with a very simple test script <? $i++ print "$i<br>"; $i++ print "$i<br>"; ...[1000 more lines like the above].. ?> 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 commended 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. I wonder if does PHP need a lot of stack to compile the source ? The stack of MorphOS can not grow. So if a program uses too much stack it can run into big problems. Any ideas how to fix this? Many thanks in advance. -Gunnar p.s. Please cc me as I'm not on this list.

Bert Slagter

22 years ago
Gunnar Von Boehn wrote:
> Normally this PHP and Apache build runs fine. > I noticed that all long scripts (over 1000 lines) will kill the > Apache/PHP build. > > I verified this with a very simple test script > <? > $i++ > print "$i<br>"; > $i++ > print "$i<br>"; > ...[1000 more lines like the above].. > ?> > > 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.
Trying to reproduce.. 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. Bert

Derick Rethans

22 years ago
On Fri, 9 Jul 2004, Gunnar von Boehn wrote:
> Hi, > > I have a very special PHP problem. > > I use Apache(1.3.31) and PHP 5.0.0rc3 on MorphOS.
Please file a bugreport. Derick

Wez Furlong

22 years ago
I wonder if it was related to the greedy read problem that was fixed a little earlier today. Please try a snapshot (it might be best to wait for the next snap). --Wez. On Sat, 10 Jul 2004 14:36:31 +0200 (CEST), Derick Rethans <derick@php.net> wrote:

Gunnar von Boehn

22 years ago
Hi,
> Please file a bugreport.
Good idea :) I just wrote a bugreport. If anyone has an idea why PHP crashes so early on MorphOS and how this could be fixed , then i'll be very thankful. Cheers Gunnar

Zeev Suraski

22 years ago
Gunnar, Did you try the latest CVS after Wez wrote his reply? Zeev At 16:52 10/07/2004, Gunnar von Boehn wrote:

Gunnar von Boehn

22 years ago
Hi Zeev, No, I did not try the latest CVS yet. Actually I'm using a MorphOS PHP build which was made by a friend of mine. As you point out that the current CVS might fix this problem, we will try it out on MorphOS. I'll report back to you. (Hopefully success :-) ) Kind regards Gunnar On Jul 11, 2004, at 10:32 AM, Zeev Suraski wrote:

Gunnar von Boehn

22 years ago
Hello Zeev, The compination of the new CVS PHP version and increasing the Stack for MOS works nice here. Everything runs fast and smoth. Many thanks Gunnar On Jul 11, 2004, at 10:32 AM, Zeev Suraski wrote:

Timm Friebe

22 years ago
On Fri, 2004-07-09 at 19:04, Gunnar von Boehn wrote:
> Hi, >
[...]
> I noticed that all long scripts (over 1000 lines) will kill the > Apache/PHP build.
Sounds like http://bugs.php.net/bug.php?id=28064 to me. - Timm