Bug report: IllegalStateException, when reading after rewinding
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. Restarts: 0: TOP-LEVEL Return to top level. [1] CL-USER(2):
On Sep 30, 2020, at 03:01, Robert Munyer <2433647181@munyer.com> wrote:
(with-open-file (in "hello.text") (list (read in) (read in nil) (file-position in :start) (read in)))
Reproduced and filed as [ticket 473][1]. [1]: https://abcl.org/trac/ticket/473 -- "A screaming comes across the sky. It has happened before but there is nothing to compare to it now."
On Sep 30, 2020, at 22:59, Mark Evenson <evenson@panix.com> wrote:
On Sep 30, 2020, at 03:01, Robert Munyer <2433647181@munyer.com> wrote:
(with-open-file (in "hello.text") (list (read in) (read in nil) (file-position in :start) (read in)))
Reproduced and filed as [ticket 473][1].
Fixed with <https://abcl.org/trac/changeset/15386> aka <https://github.com/armedbear/abcl/pull/304>. There is still probably a bit of wonkiness with reading unicode, and I have noticed that FLEXI-STREAMS fails some tests, but at least FILE-POSITION should be expected to work. Thanks for the succint bug report! -- "A screaming comes across the sky. It has happened before but there is nothing to compare to it now."
participants (2)
-
Mark Evenson
-
Robert Munyer