Re: [PHP-DEV] PHP 4.0 Bug #9136 Updated: simple script with infinitefunction calls causes seg fault

2001-02-06 Thread Derick Rethans

On Wed, 7 Feb 2001, Boian Bonev wrote:

> hi,
>
> indeed it is theoretically impossible to track this :)
>
> implement a recursive alrorithm for something e.g.:
>
> function foo($n) { // calc $n!
> if ($n<=1)
> return $n;
> else
> return foo($n-1)*$n;
> }
>
> now tell me if it is infinite or finite? ;-) this is a verification and
> cannot be solved runtime.
>
> the best thing that can be done is to set a stack limit (php function call
> level) to something reasonable and thus avoid the segfault.

This gives a problem itself, how many levels before the stack is full? Not
every function call has the same memory footprint, so you can't tell after
how many levels the stack is full.

Derick Rethans

-
  PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED]
-
JDI Media Solutions - www.jdimedia.nl - [EMAIL PROTECTED]
 H.v. Tussenbroekstraat 1 - 6952 BL Dieren - The Netherlands
-


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] PHP 4.0 Bug #9136 Updated: simple script with infinitefunction calls causes seg fault

2001-02-06 Thread Derick Rethans

On Wed, 7 Feb 2001, Cynic wrote:

> but he did:
> > Old-Bug Type: Reproduceable crash
> > Bug Type: Feature/Change Request

I need either more sleep or less alcohol :)

Derick Rethans

-
  PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED]
-
JDI Media Solutions - www.jdimedia.nl - [EMAIL PROTECTED]
 H.v. Tussenbroekstraat 1 - 6952 BL Dieren - The Netherlands
-


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] PHP 4.0 Bug #9136 Updated: simple script with infinitefunction calls causes seg fault

2001-02-06 Thread Derick Rethans

Hey,

why didn't you make it a Feature Request then? But I suppose you tried,
and wasn't be able to do that. Jani, is this a bug in the bugsystem?

BTW, I think this would be a nice idea for the new safe_mode, but I wonder
if it's possible to do with a config switch. Zeev?

Greetingz,
Derick

On 6 Feb 2001 [EMAIL PROTECTED] wrote:

> ID: 9136
> Updated by: waldschrott
> Reported By: [EMAIL PROTECTED]
> Old-Status: Closed
> Status: Feedback
> Old-Bug Type: Reproduceable crash
> Bug Type: Feature/Change Request
> Assigned To: waldschrott
> Comments:

Derick Rethans

-
  PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED]
-
JDI Media Solutions - www.jdimedia.nl - [EMAIL PROTECTED]
 H.v. Tussenbroekstraat 1 - 6952 BL Dieren - The Netherlands
-


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]