Subject: cl-swank: Slime crashes CMUCL on disconnect
From: Mark Wooding <[email-masked]>
To: Debian Bug Tracking System <[email-masked]>
Date: Thu, 19 Jul 2007 14:50:20 +0100

Package: cl-swank
Version: 1:20070409-3
Severity: normal
Tags: patch

To demonstrate:

  * Start cmucl in a window.
  * Say to Lisp:
     (load "/usr/share/common-lisp/source/slime/swank-loader.lisp")
  * Say to Lisp `(create-server)'.
  * Start Emacs.
  * Say to Emacs `M-x slime-connect RET RET RET'.
  * Play about in both to show they've connected.
  * Say to Emacs `, disconnect RET'.
  * Lisp says:

      Help! 12 nested errors.  KERNEL:*MAXIMUM-ERROR-DEPTH* exceeded.

      Debug  (type H for help)

      (LISP::DO-OUTPUT #<Stream for descriptor 6> 
        #.(SYSTEM:INT-SAP #xB7F8A000) 0 3055 ...)

    and refuses to cooperate further.  It won't listen to C-c, C-z, C-\
    or any other obvious signals; saying `killall lisp' in another shell
    works OK.

This is obviously hopeless for connecting Slime to some long-running
server, fixing something, and disconnecting again.

To fix the problem (apparently):

--- /usr/share/common-lisp/source/slime/swank.lisp	2007-05-31 21:49:06.000000000 +0100
+++ /tmp/mwooding/swank.lisp	2007-07-19 14:46:46.000000000 +0100
@@ -617,7 +617,7 @@
   (connection.socket-io *emacs-connection*))
 
 (defun close-connection (c &optional condition backtrace)
-  (format *debug-io* "~&;; swank:close-connection: ~A~%" condition)
+;;  (format *debug-io* "~&;; swank:close-connection: ~A~%" condition)
   (let ((cleanup (connection.cleanup c)))
     (when cleanup
       (funcall cleanup c)))

In case it's interesting, I'm using cmucl 19d-20061116-2.

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-4-686 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages cl-swank depends on:
ii  common-lisp-controller        6.10       This is a Common Lisp source and c

cl-swank recommends no packages.

-- no debconf information