[racket] I think I found a bug in the JITC

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Jan 30 12:39:21 EST 2012

The bug turned out to be in the bytecode compiler, which in some cases
could lose track of the fact that a variable captured by a closure has
a flonum value. The lost information was needed only by the JIT, but
compiling your example to bytecode and attempting to load it would
also provoke an error from the bytecode validator.

I've pushed a fix for the bug to the Racket git repo.

Thanks for the report!


At Mon, 30 Jan 2012 21:21:57 +0700, Erik Dominikus wrote:
> Source code for reproducing attached.
> 'racket --version' shows 5.2.
> I built from source.
> The expected result is a list, but Racket gave this error message
> instead:
> internal error: flonum position not found
>  === context ===
> /kage/racket-5.2/collects/racket/private/stream-cons.rkt:42:0:
> stream-force
> /kage/racket-5.2/collects/racket/private/stream-cons.rkt:79:0:
> stream-null?
> /kage/racket-5.2/collects/racket/private/for.rkt:388:2:
> unsafe-stream-not-empty?
> /home/erik/scheme/bug.rkt:12:0: for-loop
> /home/erik/scheme/bug.rkt: [running body]
> and upon seeing that message for the first time, I was dumbstruck. I was
> quite sure that I made no transgression since I was using the library
> normally as documented, so I took 'internal error' as a bug. After
> tracing the error message to line 656 of the file
> src/racket/src/jitstate.c, I thought the bug is in the JITC. It turns
> out that disabling the JITC (racket -j) produces the expected result, so
> I'm somewhat more sure that the bug is in the JITC.
> In advance, I'd like to thank the people who will fix this bug, if it is
> really a bug.

Posted on the users mailing list.