Re: Bug #13587 Updated: Recurence makes crash

From: Date: Tue, 09 Oct 2001 23:27:50 +0000
Subject: Re: Bug #13587 Updated: Recurence makes crash
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-67647@lists.php.net to get a copy of this message
Let's relax this thread. We're not going to rewrite the entire function calling mechanism just to sort out this issue, at least not in the near future... Zeev At 11:05 08-10-01, Jeroen van Wolffelaar wrote:
On Mon, 8 Oct 2001, Zeev Suraski wrote: At 23:23 07-10-01, Jeroen van Wolffelaar wrote:
By the way, a linked list implementation would in general be faster, while requiring size_t*stack_depth more memory. If the stack remains small all the time however, the current implementation is very slightly faster.
A linked list involves much more allocation, and is thus much slower. It's Indeed, I realized that too, later. also very poor if you want to directly access anything but the first element. I didn't know that was necessary, technically you're not talking about a stack anymore then, but nevermind... You're barking at the wrong tree, anyway. Anything built on top emalloc() is safe from out-of-memory related crashes. The crash occurs because of a stack overflow. The process stack, not the engine's zval stack. Unfortunately, it's not detectable. So that's the issue... It's understandable that it's not detectable,, such an error can occur in every single function call :( I didn't know that function calls were implemented by calling functions that don't end until the end of the PHP function. There's a solution which is easy to mention but requires some work to implement. Don't implement function calls by means of function calls... The PHP processes stack will then not be based on the script, and thus not overflow. I cannot oversee how hard it is to implement, chances are it involves a change of approach in zend_execute... Note: I just give by analysis of the problem here, I'm not saying that I think it needs to be changed. --Jeroen Jeroen van Wolffelaar Jeroen@A-Eskwadraat.nl http://www.A-Eskwadraat.nl/~jeroen


« previous php.dev (#67647) next »