Re: Infinite PHP function stack crashes Apache in Vista - Fixable?
On Feb 10, 5:39am, Kees Nuyt <k.n...@nospam.demon.nl> wrote:
> On Sat, 9 Feb 2008 14:07:45 -0800 (PST), PHPBABY3
>
>
>
>
>
> <shymath...@gmail.com> wrote:
> >On Feb 9, 3:17pm, "phantom" <nob...@blueyonder.invalid> wrote:
> >> "PHPBABY3" <shymath...@gmail.com> wrote in message
>
> >>news:8879c1fe-4041-40af-93ff-56b2b9036747@u10g2000prn.googlegroups.com....
>
> >> > The following PHP code causes Apache to crash and PHP to suspend:
>
> >> > a() ; function a(){return a();}
>
> >> > This is running EasyPHP under Vista.
>
> >> > How to fix?
>
> >> Assuming your code snippet is complete, rather than a cut down (missingany
> >> relevant detail)...
> >> put two slashes at the start of the line -
> >> //a() ; function a(){return a();}
>
> >> or delete the line completely.
>
> >But what about my experiment in Computability Theory?
>
> >P.
>
> Off topic in alt.apache.configuration,
How is one to know if there is a solution involving the
configuration? Maybe disable a non-essential feature and it runs into
a protected memory error instead of overwriting its own code and
crashing?
> but it succeeded.
> You already stated the function will never return, so
> there is no computable result ("mathematical proof").
To remove that possibility (a function gets in an infinite loop), you
would have to have a program tell you if your program is in an
infinite loop. Turing proved that impossible in 1937 (although PHP
wasn't that popular then.)
P.
> What's more, you showed that PHP doesn't optimize
> a() ; function a(){return a();}
> out of the program.
>
> In C the compiler should optimize it out, because
> a();
> isn't used anywhere.
> --
> ( Kees
> )
> c[_] The amount of time between slipping on the peel and
> landing on the pavement is precisely one bananosecond. (#72)- Hide quoted text -
>
> - Show quoted text -
|