php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9836 php unexpectedly ends on too long scripts
Submitted: 2001-03-19 08:35 UTC Modified: 2002-06-13 14:12 UTC
Votes:6
Avg. Score:4.0 ± 1.5
Reproduced:4 of 6 (66.7%)
Same Version:2 (50.0%)
Same OS:3 (75.0%)
From: jack at mobil dot cz Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.1.0 OS: linux
Private report: No CVE-ID: None
 [2001-03-19 08:35 UTC] jack at mobil dot cz
we have some long computer generated scripts on our system. when we run such a long script, php suddenly ends without producing any output and reports exit status 1.

I think php exits while parsing the script.

(I can provide an example of such script on demand)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-19 12:13 UTC] jack at mobil dot cz
I know of time limit, smart guy.

But I don't have it set to 1 sec -- that is approximately the time in which php terminates.

(I hope you mark this problem as closed now -- THAT YOU'VE SOLVED IT).

Damn.
 [2001-03-19 13:57 UTC] sniper@php.net
With that limited information you gave in the first
comments I couldn't know that.

Ok, so it doesn't crash? Just stops?
Computer generated scripts? How big?
And what do they do? 

Could you check that it doesn't crash, ie. run the php
script which 'ends' within gdb:

# gdb php
(gdb) run -f thisscriptendstoosoon.php

--Jani

 [2001-04-19 09:35 UTC] sniper@php.net
Does this happen with latest CVS from http://snaps.php.net/ ?

--Jani

 [2001-05-10 05:57 UTC] sniper@php.net
No feedback. If problem exists with PHP 4.0.5, reopen.

 [2001-08-07 05:28 UTC] jack at mobil dot cz
so it has happened again.

I again offer to provide the script so that you can see where the problem is.  I won't paste it here because it has 730K.

The script cannot really run because it is supposed to have many includes and it itself should be included by other script -- but it should fail with some reason (like unknown function).

Instead it just dies with return code 1.
 [2001-08-07 05:48 UTC] sniper@php.net
And now we have already released PHP 4.0.6. But could 
you PLEASE try the latest CVS snapshot: http://snaps.php.net/

After you have tested your script with these and if 
it still fails, provide the GDB backtrace I asked a long ago.

--Jani


 [2001-08-07 08:47 UTC] sniper@php.net
User feedback:
--------------
After further testing I found out it depends on memory limit.
But usually if you violate memory limit, you get a warning. The warning
is probably not issued when parsing the script. (I am not sure about it
as I didn't look at the sources).
---------------

User used the latest CVS snapshot.

--Jani


 [2001-12-14 15:05 UTC] yohgaki@php.net
I've verified this problem when I was taking care of other bug report.
This is critical I think.
I'll look for duplicate later.
 [2002-03-02 21:59 UTC] kalowsky@php.net
Will you please provide a link to a website containing this sample script?

Also will you share your php.ini file with us so we might debug this further?  What about your config line?  
 [2002-03-05 09:44 UTC] jack at mobil dot cz
okay. I think I described the problem well enough but I don't  want this bug closed just for 'lack of user feedback'. So do this:

create any long script. an easy (though somewhat slow) way to do this is:

#!/bin/zsh
echo 'see this' >| test.php
for i in {1..100000}; do
    echo '<? echo "...and this\\n"; ?>' >>| test.php
done


now you put 'memory_limit = 50000000' to your php.ini

run
$ php test.php
you'll get a lot of output

now change memory limit to smaller value, let's say 8000000.
$ php test.php
(failed with error code 1)

no warning given although 'error_reporting=E_ALL' in php.ini
 [2002-03-13 18:46 UTC] fabian at ahrberg dot se
I'm experiencing a similar problem on a server I use. When we upgraded to apache 1.3.22 and php 4.1.x from 4.0.x, output sometimes(!) stops on some pages. Not all pages, and not always! We have no idea what the problem is, the output just stops. Any ideas?
 [2002-03-13 18:48 UTC] fabian at ahrberg dot se
These two pages are great examples:

www.svenskamagic.com/index.php
www.svenskamagic.com/club_login.php

Reload the pages a couple of times and you'll notice the problem. 

www.svenskamagic.com/phpinfo.php might be useful.
 [2002-03-26 03:20 UTC] derick@php.net
I could not reproduce this with 4.2.0rc1. Can you please try this (www.php.net/~derick).

regards,
Derick
 [2002-03-29 12:20 UTC] jack at mobil dot cz
in 4.2.0rc1 it runs. even when I use very small memory limit, it still runs (and happily eats memory). does that mean that memory limit is now not honoured during compilation of script? (not that I think it is a bug, it could be called feature as well, I'm just curious :)
 [2002-06-13 14:12 UTC] sniper@php.net
If it works -> closed. (if you want a detailed explanation about this, ask Zeev :)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 14:01:31 2024 UTC