[slime-devel] Problem with reading from *QUERY-IO*

In a just synced SLIME running against a just synced CVS Emacs an GNU/Linux with Allegro 7.0 I seem to be having some trouble reading from *QUERY-IO*. One call works fine but two calls in a row drop me in a debugger, perhaps because there's some extra characters on the stream that are being considered as constituent chars. Here's a simple test case: CL-USER> (progn (read *query-io*) (read *query-io*)) :foo :bar ; Evaluation aborted The error in the debugger was this: Package "^@" not found. [Condition of type READER-ERROR] Restarts: 0: [ABORT] Abort handling SLIME request. 1: [ABORT] Abort entirely from this (lisp) process. Backtrace: 0: (SWANK::DEBUG-IN-EMACS #<READER-ERROR @ #x72144cd2>) 1: ((FLET SWANK:SWANK-DEBUGGER-HOOK SWANK::DEBUG-IT)) 2: (SWANK:SWANK-DEBUGGER-HOOK #<READER-ERROR @ #x72144cd2> #<Function SWANK-DEBUGGER-HOOK>) 3: (ERROR READER-ERROR :STREAM #<TWO-WAY-STREAM "" @ #x71345fd2> :FORMAT-CONTROL "~?~@[ [file position = ~d]~]" :FORMAT-ARGUMENTS ("Package ~S not found." ("") NIL)) 4: (READ #<TWO-WAY-STREAM "" @ #x71345fd2>) 5: (EVAL (PROGN (READ *QUERY-IO*) (READ *QUERY-IO*))) ... As far as I can tell the ^@ is a null (char-code #\^@) ==> 0 -Peter -- Peter Seibel peter@javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp

Peter Seibel <peter@javamonkey.com> writes:
In a just synced SLIME running against a just synced CVS Emacs an GNU/Linux with Allegro 7.0 I seem to be having some trouble reading from *QUERY-IO*. One call works fine but two calls in a row drop me in a debugger, perhaps because there's some extra characters on the stream that are being considered as constituent chars.
I don't have ACL installed to try this out. The problem does sound eerily familiar though. Could you try setting swank::*log-events* and post the output in *inferior-lisp* when reproducing the problem?

Luke Gorrie <luke@synap.se> writes:
I don't have ACL installed to try this out. The problem does sound eerily familiar though.
Could you try setting swank::*log-events* and post the output in *inferior-lisp* when reproducing the problem?
The problem seems to be that stream-unread-char is called with a #\null character instead of a #\newline. It could be a peculiarity of the two-way-streams in Allegro or a bug. (progn (read *standard-input*) (read *standard-input*)) seems to work as expected. We could probably ignore the character passed to stream-unread-char and only decrement the buffer index. Helmut.
participants (3)
-
Helmut Eller
-
Luke Gorrie
-
Peter Seibel