Closed marcomaggi closed 12 years ago
It happens only when debug mode is on along with optimize level 2; also changing the following in "ikarus.compiler.source-optimizer.ss":
[(2)
(source-optimize expr)]
to:
[(2)
(parameterize ([cp0-size-limit 0])
(source-optimize expr))]
makes the problem go away.
The bug goes away for the simple test script, but not in more complicated cases having the same quasiquote use. It seems the only way to go around this is to set optimisation level to zero from the command line, rc file or to force it to zero artificially at process start.
Reopening this issue be cause in the head of the assembler branch the source optimizer has been reenabled. The bug is still there when running:
$ vicare -O2 --debug script.sps
or:
$ vicare -O1 --debug script.sps
This bug has nothing to do with quasiquote. The following program:
(import (rnrs))
(vector (display "ciao\n"))
(flush-output-port (current-output-port))
will print twice "ciao" with both the latest vicare from the assembler branch and the latest available ikarus, both when running with options '--debug -O1'; without --debug or without -O1 no error happens.
The problem is that somehow the function debug-call wrapping the function call sin the program is called twice with the same arguments.
Unless I am mistaken: this does not happen at the REPL, only with programs.
This should be fixed in the head of the assembler branch.
Running the program below as:
while in debug mode:
notice that changing the expression to "(quasiquote ,(b))" does not exercise the bug.
This is bug #563577 in the Ikarus bug tracker.