vicare icon indicating copy to clipboard operation
vicare copied to clipboard

Graph syntax reader bug

Open ijp opened this issue 14 years ago • 2 comments

I just installed Vicare Scheme and came across a bug in the reader, it is also present in Ikarus. If you are constructing a graph using reader syntax as opposed to by mutating the list explicitly, and you forget the quote, then it will hang your system.

'#0=(a b c #0#)

#0=(a b c #0#)

#0=(a b c #0#)

hangs

While I am sure that this is a bug, I am not sure whether or not the 'correct' solution is to have this be an error, or to allow it a la bytevectors.

ijp avatar Jun 28 '10 00:06 ijp

The reader works fine, the problem is somewhere around the call to LOAD-R6RS-SCRIPT in "ikarus.main.ss"; that is: the expander (probably) or the compiler enters an infinite loop while visiting the recursive input S-Expression.

I agree that it would be nice to detect this problem and raise an error, but deep understanding of the expander is needed for this and I do not have it now. For the time being, I tag this as wont-fix, because graph notation is just a (sometimes useful) extension and not part of R6RS.

marcomaggi avatar Jun 28 '10 09:06 marcomaggi

More on this from Ikarus bug 809250 reported by Göran Weinholt:

Per Bothner posted a message on scheme-reports: http://lists.scheme-reports.org/pipermail/scheme-reports/2011-July/001142.html The context is that R7RS probably will have the syntax for self-referential data structures. The expression he posted gives an infinite loop in Ikarus:

Ikarus Scheme version 0.0.4-rc1+, 64-bit (revision 1870, build 2010-11-07) Copyright (c) 2006-2009 Abdulaziz Ghuloum

`#0=(,x #0#) [Ikarus uses 100% cpu here.]

marcomaggi avatar Jul 14 '11 05:07 marcomaggi