Infinite recursion

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Infinite recursion

Guillermo Polito
Hi,

Yesterday I got into an infinite recursion, because of adding an ordered collection into itself.  And #hash is defined in terms of its containees, hehe.

Why I did that? It doesn't really matters. I was testing a little project I'm doing for the University.

So I came into an infinite recursion, which didn't stop until the VM run out of memory...  And the question is.. Shouldn't it throw an error like a stack overflow when we run into those cases?

Cheers,
Guille
Reply | Threaded
Open this post in threaded view
|

Re: Infinite recursion

Schwab,Wilhelm K
I asked this some time back.  One dark side of doing this is that it *can* result in unwanted/inappropriate failures.  In practice though, Dolphin's limits on the stack has been a good thing.




________________________________________
From: [hidden email] [[hidden email]] On Behalf Of Guillermo Polito [[hidden email]]
Sent: Wednesday, November 17, 2010 11:44 AM
To: [hidden email]
Subject: [Pharo-project] Infinite recursion

Hi,

Yesterday I got into an infinite recursion, because of adding an ordered collection into itself.  And #hash is defined in terms of its containees, hehe.

Why I did that? It doesn't really matters. I was testing a little project I'm doing for the University.

So I came into an infinite recursion, which didn't stop until the VM run out of memory...  And the question is.. Shouldn't it throw an error like a stack overflow when we run into those cases?

Cheers,
Guille

Reply | Threaded
Open this post in threaded view
|

Re: Infinite recursion

Guillermo Polito
I will insist here :P.

What is the desired behavior for this situation?  So if it is an Issue, I may open an entry in the tracker...

On Wed, Nov 17, 2010 at 1:46 PM, Schwab,Wilhelm K <[hidden email]> wrote:
I asked this some time back.  One dark side of doing this is that it *can* result in unwanted/inappropriate failures.  In practice though, Dolphin's limits on the stack has been a good thing.




________________________________________
From: [hidden email] [[hidden email]] On Behalf Of Guillermo Polito [[hidden email]]
Sent: Wednesday, November 17, 2010 11:44 AM
To: [hidden email]
Subject: [Pharo-project] Infinite recursion

Hi,

Yesterday I got into an infinite recursion, because of adding an ordered collection into itself.  And #hash is defined in terms of its containees, hehe.

Why I did that? It doesn't really matters. I was testing a little project I'm doing for the University.

So I came into an infinite recursion, which didn't stop until the VM run out of memory...  And the question is.. Shouldn't it throw an error like a stack overflow when we run into those cases?

Cheers,
Guille


Reply | Threaded
Open this post in threaded view
|

Re: Infinite recursion

Stéphane Ducasse
In reply to this post by Schwab,Wilhelm K
ideally there should be (may be there is one) a watchdog on the stack but may be this is on the vm side close to the gc.

On Nov 19, 2010, at 1:30 PM, Guillermo Polito wrote:

> I will insist here :P.
>
> What is the desired behavior for this situation?  So if it is an Issue, I may open an entry in the tracker...
>
> On Wed, Nov 17, 2010 at 1:46 PM, Schwab,Wilhelm K <[hidden email]> wrote:
> I asked this some time back.  One dark side of doing this is that it *can* result in unwanted/inappropriate failures.  In practice though, Dolphin's limits on the stack has been a good thing.
>
>
>
>
> ________________________________________
> From: [hidden email] [[hidden email]] On Behalf Of Guillermo Polito [[hidden email]]
> Sent: Wednesday, November 17, 2010 11:44 AM
> To: [hidden email]
> Subject: [Pharo-project] Infinite recursion
>
> Hi,
>
> Yesterday I got into an infinite recursion, because of adding an ordered collection into itself.  And #hash is defined in terms of its containees, hehe.
>
> Why I did that? It doesn't really matters. I was testing a little project I'm doing for the University.
>
> So I came into an infinite recursion, which didn't stop until the VM run out of memory...  And the question is.. Shouldn't it throw an error like a stack overflow when we run into those cases?
>
> Cheers,
> Guille
>
>