Date: 07/09/00
- Next message: Joshua Brindle: "[PHP-DEV] Apache2"
- Previous message: Zeev Suraski: "Re: [PHP-DEV] *crash* on try to find out how many nestinglevelsare allowed"
- In reply to: Shane Caraveo: "Re: [PHP-DEV] *crash* on try to find out how many nestinglevelsare allowed"
- Next in thread: Dominic J. Eidson: "Re: [PHP-DEV] *crash* on try to find out how many nesting levelsare allowed"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 12:15 09/07/00 -0400, Shane Caraveo wrote:
<cut>
> > It can only be fixed, as far as I know, by
> > adding code which will limited the amount of recursive function calls. This
> > will not only slow down PHP but it will also pose the question of where the
> > limit is. Not all systems have the same stack size or each up the stack at
> > the same rate.
> > In my opinion, we are better off leaving it the way it is for now although
> > for multi-threaded servers we might want to enable the *slow* approach.
> > Anyway, maybe the best is not to write infinite recursion?
> >
> > Andi
>
>
>I agree that writing infinite recursion is not a good thing and should
>not be done. I disagree that it should crash php. Sometimes bugs (in
>scripts, certainly not in php itself ;-) just happen, possibly even
>infinite recursion. On my server, there are several people who write
>scripts, not all being real programmers, I can see stuff happening that
>could lead to a crash, which could take down all the sites on the
>server. If it's possible to prevent such a crash, that is an option I
>would want.
Luckily at least with Apache crashing the web server isn't a big deal.
Anyway, as I said things aren't always that simple
>Do you have any remote idea of how much it would slow down php? You and
>Zeev added a lot of performance to php, I would rather sacrifice some of
>that new speed for stability. I may be wrong as I know next to nothing
>about parsers, but I would think it should be possible to check the
>remaining stack size and throw a stack overflow error (if that happens),
>rather than crashing. Doing it this way would also do away with any
>need to count the number of recursions (and have some limit on that).
I disagree. I don't want to slow down PHP significantly for this purpose.
Checking the current stack size is a system call and it is something you
would have to add logic in every function call to check it.
To make a long story short, I'm open to ideas, but I don't want to slow
down PHP significantly for 100% of the people when 0.00000001% have a
problem with their Apache server crashing because they write infinite
recursion. The Apache parent process will respawn a new one.
Andi
--- Andi Gutmans <andi <email protected>> http://www.zend.com/-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Joshua Brindle: "[PHP-DEV] Apache2"
- Previous message: Zeev Suraski: "Re: [PHP-DEV] *crash* on try to find out how many nestinglevelsare allowed"
- In reply to: Shane Caraveo: "Re: [PHP-DEV] *crash* on try to find out how many nestinglevelsare allowed"
- Next in thread: Dominic J. Eidson: "Re: [PHP-DEV] *crash* on try to find out how many nesting levelsare allowed"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

