Bug report: IllegalStateException, when reading after rewinding

Robert Munyer 2433647181 at munyer.com
Wed Sep 30 01:01:32 UTC 2020

The code below works in CCL, CLISP and SBCL, but not in ABCL.

$ echo hello > hello.text
$ java -jar abcl-1.7.1.jar
Armed Bear Common Lisp 1.7.1
Java 1.8.0_265 Oracle Corporation
OpenJDK 64-Bit Server VM
Low-level initialization completed in 0.181 seconds.
Startup completed in 0.945 seconds.
Type ":help" for a list of available commands.
CL-USER(1): (with-open-file (in "hello.text")
              (list (read in)
                    (read in nil)
                    (file-position in :start)
                    (read in)))
java.lang.IllegalStateException: Current state = CODING_END, new state = CODING
        at java.nio.charset.CharsetDecoder.throwIllegalStateException(CharsetDecoder.java:992)
        at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:572)
        at org.armedbear.lisp.util.RandomAccessCharacterFile.read(RandomAccessCharacterFile.java:392)

[ many stack frames elided ]

        at org.armedbear.lisp.Main$1.run(Main.java:48)
        at java.lang.Thread.run(Thread.java:748)
#<THREAD "interpreter" {2CD58E2}>: Debugger invoked on condition of type ERROR
  Caught java.lang.IllegalStateException: Current state = CODING_END, new state = CODING.
  0: TOP-LEVEL Return to top level.
[1] CL-USER(2):

More information about the armedbear-devel mailing list