chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] jbogenturfa'i: "Error: stack overflow"


From: Felix
Subject: Re: [Chicken-users] jbogenturfa'i: "Error: stack overflow"
Date: Mon, 06 Dec 2010 05:15:40 -0500 (EST)

From: Alan Post <address@hidden>
Subject: Re: [Chicken-users] jbogenturfa'i: "Error: stack overflow"
Date: Sun, 5 Dec 2010 16:15:26 -0700

> On Sun, Dec 05, 2010 at 06:34:44PM +0100, Felix wrote:
>> From: Alan Post <address@hidden>
>> Subject: Re: [Chicken-users] jbogenturfa'i: "Error: stack overflow"
>> Date: Sun, 5 Dec 2010 08:30:50 -0700
>> 
>> > If I comment-out that (if (not (hash-table-exists? ...)) ...) statement in
>> > the 'never use the cache result' version of the memoizer, the code runs
>> > without a stack overflow.  Does that seem odd to you?
>> 
>> It certainly does. Does this happen in compiled code only, or in both
>> interpreted and compiled code? Can you provide me with instructions to
>> reproduce this error?
>> 
> 
> It happens in both interpreted and compiled code.  I've provided
> instructions on how to reproduce this error here, with instructions
> for creating the problem in compiled and interpreted code:
> 
>   https://bugs.call-cc.org/ticket/440
> 

Thanks a lot, Alan. The problem is that the key used in the hashtable
lookup contains circular data, which causes `equal?' to recurse
endlessly (I have changed the error message to something more
helpful). You seem to use lists containing closures, and these
closures hold circular data or refer indirectly to themselves.

Now, what to do? I'm not sure whether using procedures in equality
tests (even if implicit, like when used as hash-table keys) is a great
idea, since procedure-quality is a bit of a subtle thing.  I'm also
not sure how we should handle this in the hash-table libraries.

Should `equal?' descend into procedures, or just do an `eq?' test?
R5RS only requires a structural equivalence test for pairs and
vectors, but being able to contain (say) records is something that's
too handy not to have.

Would the language lawyers please step forward and comment?


cheers,
felix



reply via email to

[Prev in Thread] Current Thread [Next in Thread]