Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Infinite PHP function stack crashes Apache in Vista - Fixa..

 
   Web Hosting Problem Solving Community! (Home) -> Apache RSS
Next:  Localhost  
Author Message
PHPBABY3

External


Since: Feb 07, 2008
Posts: 11



(Msg. 1) Posted: Sat Feb 09, 2008 7:59 am
Post subject: Infinite PHP function stack crashes Apache in Vista - Fixable?
Archived from groups: alt>apache>configuration (more info?)

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?

Thanks,

P.

 >> Stay informed about: Infinite PHP function stack crashes Apache in Vista - Fixa.. 
Back to top
Login to vote
PHPBABY3

External


Since: Feb 07, 2008
Posts: 11



(Msg. 2) Posted: Sat Feb 09, 2008 2:07 pm
Post subject: Re: Infinite PHP function stack crashes Apache in Vista - Fixable? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Feb 9, 3:17 pm, "phantom" <nob... DeleteThis @blueyonder.invalid> wrote:
> "PHPBABY3" <shymath... DeleteThis @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 (missing any
> 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.

 >> Stay informed about: Infinite PHP function stack crashes Apache in Vista - Fixa.. 
Back to top
Login to vote
Luuk

External


Since: Feb 09, 2008
Posts: 9



(Msg. 3) Posted: Sat Feb 09, 2008 5:11 pm
Post subject: Re: Infinite PHP function stack crashes Apache in Vista - Fixable? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

PHPBABY3 schreef:
> The following PHP code causes Apache to crash and PHP to suspend:
>
> a() ; function a(){return a();}
>


what do you expect this code to do?

--
Luuk
 >> Stay informed about: Infinite PHP function stack crashes Apache in Vista - Fixa.. 
Back to top
Login to vote
ed

External


Since: Feb 08, 2008
Posts: 13



(Msg. 4) Posted: Sat Feb 09, 2008 5:11 pm
Post subject: Re: Infinite PHP function stack crashes Apache in Vista - Fixable? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

PHPBABY3 wrote:
> 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?
>
> Thanks,
>
> P.

The code is recursive.

The function a has to call a to get it's return value.

It will never return.

- --
The T3 to Qwicky Mart is wigging because of burned out dilithium crystals.
The T1000 is blaming George Lucas.
:: http://www.s5h.net/ :: http://www.s5h.net/gpg.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHrd+M4dyr7s6PRYgRAgfNAJ9wvLjLO/MyOsOOJv82u9Vr82oVfQCfbirI
6GZduUj/3cOxzodp1ddIxMo=
=6HFh
-----END PGP SIGNATURE-----
 >> Stay informed about: Infinite PHP function stack crashes Apache in Vista - Fixa.. 
Back to top
Login to vote
Kees Nuyt

External


Since: Oct 25, 2006
Posts: 78



(Msg. 5) Posted: Sat Feb 09, 2008 5:11 pm
Post subject: Re: Infinite PHP function stack crashes Apache in Vista - Fixable? [Login to view extended thread Info.]
Archived from groups: alt>apache>configuration, others (more info?)

On Sat, 9 Feb 2008 07:59:51 -0800 (PST), PHPBABY3
<shymathguy.DeleteThis@gmail.com> wrote:

>
>The following PHP code causes Apache to crash and PHP to suspend:
>
>a() ; function a(){return a();}

Any language would either crash on this (stack overflow),
or never finish (auto-optimized recursion to iteration).

>This is running EasyPHP under Vista.
>
>How to fix?

Add an end condition to function a() which stops the
recursion, so the nesting is limited.

It shouldn't crash Apache, it should only crash the PHP
script. The only reason I can think of is a too high
memory limit in php.ini
But that's more a comp.lang.php question.
Cross-posted to comp.lang.php and followup-to set.

>Thanks,
>
>P.
--
( Kees
)
c[_] I have a rock garden. 3 of them died last week. (#176)
 >> Stay informed about: Infinite PHP function stack crashes Apache in Vista - Fixa.. 
Back to top
Login to vote
phantom

External


Since: Aug 23, 2007
Posts: 66



(Msg. 6) Posted: Sat Feb 09, 2008 5:11 pm
Post subject: Re: Infinite PHP function stack crashes Apache in Vista - Fixable? [Login to view extended thread Info.]
Archived from groups: alt>apache>configuration (more info?)

"PHPBABY3" <shymathguy.RemoveThis@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 (missing any
relevant detail)...
put two slashes at the start of the line -
//a() ; function a(){return a();}

or delete the line completely.
 >> Stay informed about: Infinite PHP function stack crashes Apache in Vista - Fixa.. 
Back to top
Login to vote
PHPBABY3

External


Since: Feb 07, 2008
Posts: 11



(Msg. 7) Posted: Sun Feb 10, 2008 6:52 am
Post subject: Re: Infinite PHP function stack crashes Apache in Vista - Fixable? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Feb 10, 5:39 am, Kees Nuyt <k.n....TakeThisOut@nospam.demon.nl> wrote:
> On Sat, 9 Feb 2008 14:07:45 -0800 (PST), PHPBABY3
>
>
>
>
>
> <shymath....TakeThisOut@gmail.com> wrote:
> >On Feb 9, 3:17 pm, "phantom" <nob....TakeThisOut@blueyonder.invalid> wrote:
> >> "PHPBABY3" <shymath....TakeThisOut@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 (missing any
> >> 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 -
 >> Stay informed about: Infinite PHP function stack crashes Apache in Vista - Fixa.. 
Back to top
Login to vote
Kees Nuyt

External


Since: Oct 25, 2006
Posts: 78



(Msg. 8) Posted: Sun Feb 10, 2008 8:05 am
Post subject: Re: Infinite PHP function stack crashes Apache in Vista - Fixable? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sat, 9 Feb 2008 14:07:45 -0800 (PST), PHPBABY3
<shymathguy.TakeThisOut@gmail.com> wrote:

>On Feb 9, 3:17 pm, "phantom" <nob....TakeThisOut@blueyonder.invalid> wrote:
>> "PHPBABY3" <shymath....TakeThisOut@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 (missing any
>> 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, but it succeeded.
You already stated the function will never return, so
there is no computable result ("mathematical proof").

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)
 >> Stay informed about: Infinite PHP function stack crashes Apache in Vista - Fixa.. 
Back to top
Login to vote
Kees Nuyt

External


Since: Oct 25, 2006
Posts: 78



(Msg. 9) Posted: Sun Feb 10, 2008 5:05 pm
Post subject: Re: Infinite PHP function stack crashes Apache in Vista - Fixable? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sun, 10 Feb 2008 06:52:29 -0800 (PST), PHPBABY3
<shymathguy.RemoveThis@gmail.com> wrote:

>On Feb 10, 5:39 am, Kees Nuyt <k.n....RemoveThis@nospam.demon.nl> wrote:
>> On Sat, 9 Feb 2008 14:07:45 -0800 (PST), PHPBABY3
>>
>> 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?

I don't know of any configuration options in Apache to
limit the privileges of a program other than the userID in
which CGIs are launched and what the operating system
offers.

PHP does have some options (memory usage, timeout), but
that's off topic here.

>> 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.)

I double qouted "mathematical proof" on purpose.
Turings proof is probably meant in the general case of an
unknown program. In this case you carefully crafted an
infinite recursion on purpose. And you apparently
succeeded.

I don't think a detailed discussion on Turing etc. is on
topic in alt.apache.configuration.

As I said before, I don't know of any way to prevent
Apache crashing on this in httpd.conf, so this will
probably be my last contribution to this thread.
--
( Kees
)
c[_] Crime does not pay...as well as politics. (#356)
 >> Stay informed about: Infinite PHP function stack crashes Apache in Vista - Fixa.. 
Back to top
Login to vote
fwahdlyhq

External


Since: Apr 17, 2008
Posts: 1



(Msg. 10) Posted: Thu Apr 17, 2008 2:19 am
Post subject: fwahdlyhq [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

V0wwqD <a href="http://rfdcxmqlkbiu.com/">rfdcxmqlkbiu</a>,
[url=http://cgpsylopjgec.com/]cgpsylopjgec[/url],
[link=http://micjvehohqci.com/]micjvehohqci[/link],
http://voaswcsnbmnx.com/
 >> Stay informed about: Infinite PHP function stack crashes Apache in Vista - Fixa.. 
Back to top
Login to vote
trdcilgmvx

External


Since: Apr 24, 2008
Posts: 1



(Msg. 11) Posted: Thu Apr 24, 2008 6:53 pm
Post subject: trdcilgmvx [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

28xZHq <a href="http://ltfqfruojlwf.com/">ltfqfruojlwf</a>,
[url=http://ckaglmyqkswz.com/]ckaglmyqkswz[/url],
[link=http://zoqksorqomtk.com/]zoqksorqomtk[/link],
http://aezkyoboigpb.com/
 >> Stay informed about: Infinite PHP function stack crashes Apache in Vista - Fixa.. 
Back to top
Login to vote
vabflx

External


Since: May 19, 2008
Posts: 1



(Msg. 12) Posted: Mon May 19, 2008 2:29 pm
Post subject: vabflx [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

uNiScV <a href="http://yscyxzspnusq.com/">yscyxzspnusq</a>,
[url=http://zrpofxgriqyg.com/]zrpofxgriqyg[/url],
[link=http://golmjeoryvwq.com/]golmjeoryvwq[/link],
http://lggzovtqdltn.com/
 >> Stay informed about: Infinite PHP function stack crashes Apache in Vista - Fixa.. 
Back to top
Login to vote
D. Stussy

External


Since: Nov 01, 2007
Posts: 25



(Msg. 13) Posted: Mon May 19, 2008 6:02 pm
Post subject: Re: Infinite PHP function stack crashes Apache in Vista - Fixable? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"PHPBABY3" <shymathguy DeleteThis @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?

You don't. Vista crashes Vista - there is no hope.
 >> Stay informed about: Infinite PHP function stack crashes Apache in Vista - Fixa.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Getting stack trace from runaway apache - In our HP-UX 11 production environment, we use apache 2 servers as front-ends for BEA Weblogic servers via BEA's weblogic plugin.Under some conditions, an apache thread can go into a runaway condition, consuming 90% of a cpu and spending 30% of its..

sendmail function under windows's Apache 1.3 - Hello Everyone, I am using Windows2000, Apache, Mysql and Php. Now I have a script (Php) which use the sendmail function. I get an error and can't find the answer. (errorcode 1) Are there people who knows how to work with the sendmail module (if this..

Problem with Function Pointers in my Module in Apache 1.3... - The Problem : I am using a function pointer in my WebServer module to call OpenSSL function - SSL_get_peer_certificate() from the main Apache process. The function definition is taken from the OpenSSL Library : libssl.a . On execution, I get the..

Apache 2.2 and Windows Vista - 400 Bad Request Your browser sent a request that this server could not understand. Driving me mad, how do you fix this.? I'm trying to get cakephp working on my local machine to work on the run, but it doesn't want to know anything about this. Apache..

Apache Slow on Vista - Hi all, I am new here so "hi" and I hope this hasn't been answered before (I did check on google groups!). I have a development server (Apache 2.2.4 / PHP 5.2.3) running on Vista. It seems to be set-up ok and everything works... but it is a...
   Web Hosting Problem Solving Community! (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]