[armedbear-devel] encoding bug in Stream.readPreservingWhitespace (classpath)

Eric Marsden eric.marsden at free.fr
Sun Apr 25 09:15:12 UTC 2010


Hi,

Attempting to run ABCL with jamvm (which uses the classpath libraires),
I get 

,----
| Armed Bear Common Lisp 0.20.0-dev
| Java 1.5.0 GNU Classpath
| JamVM
| Low-level initialization completed in 0.371 seconds.
| Exception in thread "interpreter" java.lang.IllegalStateException
|    at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:163)
|    at org.armedbear.lisp.util.DecodingReader.unread(DecodingReader.java:168)
|    at org.armedbear.lisp.util.DecodingReader.unread(DecodingReader.java:156)
|    at org.armedbear.lisp.Stream._unreadChar(Stream.java:1708)
|    at org.armedbear.lisp.Stream._readToken(Stream.java:1144)
|    at org.armedbear.lisp.Stream.readToken(Stream.java:1009)
|    at org.armedbear.lisp.Stream.processChar(Stream.java:508)
|    at org.armedbear.lisp.Stream.readList(Stream.java:660)
|    at org.armedbear.lisp.LispReader$3.execute(LispReader.java:88)
|    at org.armedbear.lisp.Stream.processChar(Stream.java:505)
|    at org.armedbear.lisp.Stream.readPreservingWhitespace(Stream.java:484)
|    at org.armedbear.lisp.Stream.readPreservingWhitespace(Stream.java:492)
|    at org.armedbear.lisp.Stream.read(Stream.java:430)
|    at org.armedbear.lisp.Load.loadStream(Load.java:556)
|    at org.armedbear.lisp.Load.loadFileFromStream(Load.java:522)
|    at org.armedbear.lisp.Load.loadFileFromStream(Load.java:412)
|    at org.armedbear.lisp.Load.loadSystemFile(Load.java:337)
|    at org.armedbear.lisp.Interpreter.initializeLisp(Interpreter.java:159)
|    at org.armedbear.lisp.Interpreter.createDefaultInstance(Interpreter.java:93)
|    at org.armedbear.lisp.Main$1.run(Main.java:48)
|    at java.lang.Thread.run(Thread.java:745)
`----

I see in org.armedbear.lisp.Stream.read() a sequence

                    int n = _readChar();
                    if (n >= 0) {
                        char c = (char) n; // ### BUG: Codepoint conversion
                        Readtable rt = rta.rt(thread);
                        if (!rt.isWhitespace(c))
                            _unreadChar(c);
                    }

which seems likely to be related to this problem. If I print
the offending character in DecodingReader.unread() it looks like a
#\space. Any suggestions on how to proceed?
                
-- 
Eric Marsden




More information about the armedbear-devel mailing list