Just had SLIME explode quite magnificently for me. ;-)
Was playing around with TRIVIAL-SOCKETS on SBCL 0.8.17.24.
You'll need these simple definitions, in my case in foo.lisp:
(defun crlf (s) (write-char #\Return s) (write-char #\Newline s))
(defun http-get (site page) (with-open-stream (s (trivial-sockets:open-stream site 80)) (format s "GET ~A HTTP/1.0" page) (crlf s) (format s "Host: ~A" site) (crlf s) (crlf s) (force-output s) (loop for line = (read-line s nil nil) while line do (format t "~A~%" line))))
Test case is pretty simple. Start SLIME. In the SLIME REPL:
CL-USER> (require :asdf) NIL CL-USER> (require :trivial-sockets) NIL CL-USER> (load "/home/dave/foo.lisp") T CL-USER> (http-get "www.cboe.com" "/")
<lots of output...> <and then...>
debugger invoked on a TYPE-ERROR in thread 14342: The value 956 is not of type (UNSIGNED-BYTE 8).
You can type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name): 0: [ABORT ] Abort handling SLIME request. 1: Reduce debugger level (leaving debugger, returning to toplevel). 2: [TOPLEVEL] Restart at toplevel READ/EVAL/PRINT loop. (SB-IMPL::OUTPUT-BYTES/LATIN-1 5 #<FILE-STREAM for "a constant string" {9829B21}> "(:debug 0 2 ("The value 956 is not of type (UNSIGNED-BYTE 8)." " [Condition of type TYPE-ERROR]" nil nil) (("ABORT" "Abort handling SLIME request.") ("ABORT" "Reduce debugger level (leaving debugger, returning to toplevel).") ("TOPLEVEL " "Restart at toplevel READ/EVAL/PRINT loop.")) ((0 "(SB- IMPL::OUTPUT-BYTES/LATIN-1 5 #<FILE-STREAM for \"a constant string\ " {9829B21}> \"(:debug 0 1 (\\\"The value 956 is not of type (UNSIGNED-BYTE 8).\\\" \\\" [Condition of type TYPE-ERROR]\\ \" nil nil) ((\\\"ABORT\\\" \\\"Abort handling SLIME request.\\\") (\\\"ABORT\\\" \\\"Reduce debugger level (leaving debugger, returning to toplevel).\\\") (\\\"TOPLEVEL\\ \\" \\\"Restart at toplevel READ/EVAL/PRINT loop.\\\")) ((0 \ \\"(SB-IMPL::OUTPUT-BYTES/LATIN-1 5 #<FILE-STREAM for \\\\\\\ "a constant string\\\\\\\" {9833569}> \\\\\\\"new
debugger invoked on a TYPE-ERROR in thread 14342: The value 956 is not of type (UNSIGNED-BYTE 8).
You can type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name): 0: [ABORT ] Abort handling SLIME request. 1: Reduce debugger level (leaving debugger, returning to toplevel). 2: [TOPLEVEL] Restart at toplevel READ/EVAL/PRINT loop.
At this point, SLIME gets pretty confused. Any attempt at making any forward progress (invoking any restarts, etc.) just results in more problems (lands you right back in the debugger). At some point, Emacs seems to get pretty confused, too.
I tried this on SBCL without using SLIME (repl in a term window) and it seems to work fine. I'm guessing that there is some sort of problem with Swank communicating with Emacs as it tries to relay the FORMAT output, probably caused by something in the new SBCL Unicode support.
Note that you have to use the CBOE website (www.cboe.com) to trigger this. There is something on that page (as simple as a character with the high order bit set??) that triggers this. I have tried other sites and they seem to work fine. I also replaced the (FORMAT T "~A~%" LINE) with (FORMAT T "foo~%") and it prints "foo" very nicely for each line on the web page and does not trigger the bug.
If there is a better place/method to file a bug report, let me know.
On Tue, 2004-12-21 at 12:46 -0800, Dave Roberts wrote:
Was playing around with TRIVIAL-SOCKETS on SBCL 0.8.17.24.
I should have also reported that this was with SLIME CVS from today, reporting "; SLIME 2004-12-16" upon startup.
Dave Roberts ldave@droberts.com writes:
On Tue, 2004-12-21 at 12:46 -0800, Dave Roberts wrote:
Was playing around with TRIVIAL-SOCKETS on SBCL 0.8.17.24.
I should have also reported that this was with SLIME CVS from today, reporting "; SLIME 2004-12-16" upon startup.
My guess: you're running in a Unicode locale, and are expecting high-bits to be communicated properly between emacs and sbcl. This is possible, but is not the default: you need to set slime-net-coding-system to utf-8-unix before starting slime/swank.
I have had this work for me at least once :)
Cheers,
Christophe
On Dec 29, 2004, at 1:33 PM, Christophe Rhodes wrote:
Dave Roberts ldave@droberts.com writes:
On Tue, 2004-12-21 at 12:46 -0800, Dave Roberts wrote:
Was playing around with TRIVIAL-SOCKETS on SBCL 0.8.17.24.
I should have also reported that this was with SLIME CVS from today, reporting "; SLIME 2004-12-16" upon startup.
That crash, on the Lisp side, appears to be a type error upon stuffing a unicode char down the throat of stream that's not unicode. You can create something that appears identical by doing (char-code #x2222) in the REPL; while (progn (char-code #x2222) nil) doesn't do it. It then goes into a tail spin reporting the error (along with the unicode char) on the very same output stream.
On the slime side it just doesn't deal well with the stack exhaustion that happens over on the Lisp side. "Doesn't deal well" is sufficiently severe that I need to restart emacs to get it working again; all the various reset, restart, abort combinations attempt to launch a fresh lisp but they never get past the connection handshake.
My guess: you're running in a Unicode locale, and are expecting high-bits to be communicated properly between emacs and sbcl. This is possible, but is not the default: you need to set slime-net-coding-system to utf-8-unix before starting slime/swank.
I have had this work for me at least once :)
Running SBCL & slime CVS head of a 5 days ago; via a mule enabled xemacs 21.5 beta 18 setting utf-8-unix is working dependably for me. Many other combinations didn't work.
To first order the trick is getting lots of things just right. The Lisp needs to be unicode aware. Lisp side streams to have :utf-8 for their external format, use (stream-external-format *standard-output*) to check that. The emacs needs to be unicode capable, i.e. mule. Then you need unicode fonts, i.e. gnu intl fonts. I wasn't able to get Mac font support working; since the charsets don't align - there are big5 fonts for example but no unicode fonts. For that reason I'm using X for my window manager.
I've not tried the new released version of SBCL yet.
- ben
ps. Thanks to all for their hard work on this stuff!