Hi all,
Following recent advices on c.l.l, I just tried a recently downloaded (02/04/04) version of SLIME. I am using it with XEmacs 21.4.12 and clisp 2.32, and I'm getting the following strange behaviour :
The first invocation of M-x slime RET in a just started XEmacs freezes it
the following sequences of evaluated forms freeze it as weel :
(slime-maybe-start-lisp) (slime-read-port-and-connect) or (slime-maybe-start-lisp) (slime-start-swank-server) ;; eval only once ! (setq port (slime-read-swank-port)) (slime-connect "localhost" port)
but NOT the following
(slime-maybe-start-lisp) (slime-start-swank-server) (setq *proc* (slime-net-connect "localhost" port)) (slime-init-connection *proc*)
which works fine (i.e. after evaluating a few more forms I get a fully functional SLIME)
In all cases, the lisp is started ok, as is the swank server. The problem seems to me to be located somewhere in the slime-init-connection/slime-net-connect interaction.
I tried to put a conditional in slime-connect do process to slime-init-connection only if (slime-net-connect "localhost" port) returns, and to increase the delay between each run-with-timer (the swank server gets started after a good 3-4 seconds) but it didn't seem to help.
The XEmacs stack dump I get when killing it is the following : Lisp backtrace follows: # (unwind-protect ...) accept-process-output(nil 0 10000) (while t (accept-process-output nil 0 10000) (when nil (recursive-edit) (error "Evaluation aborted."))) # bind (inhibit-quit debug-on-quit) (let ((debug-on-quit t) (inhibit-quit nil)) (while t (accept-process-output nil 0 10000) (when nil ... ...))) # (catch slime-result-66523 ...) (catch tag (slime-rex (tag sexp) (sexp package) (... ... ...) (... ...)) (let (... ...) (while t ... ...))) # (unwind-protect ...) (unwind-protect (catch tag (slime-rex ... ... ... ...) (let ... ...))) # bind (slime-stack-eval-tags tag) (let* ((tag ...) (slime-stack-eval-tags ...)) (unwind-protect (catch tag ... ...))) # bind (package sexp) slime-eval((swank:getpid)) (let ((--store--66522 ...)) (slime-with-connection-buffer nil (setq slime-pid:connlocal --store--66522) --stor e--66522)) (setf (slime-pid) (slime-eval (quote ...))) # bind (proc) slime-init-connection-state(#<network connection "SLIME Lisp" (1219 . "localhost") state:exit>) # bind (slime-dispatching-connection) (let ((slime-dispatching-connection proc)) (slime-init-connection-state proc) (slime-select-connection proc) p roc) # bind (proc) slime-init-connection(#<network connection "SLIME Lisp" (1219 . "localhost") state:exit>) (progn (message "slime-net-connect succeeded...") (slime-init-connection proc)) (if proc (progn (message "slime-net-connect succeeded...") (slime-init-connection proc))) (when proc (message "slime-net-connect succeeded...") (slime-init-connection proc)) # bind (proc) (let ((proc ...)) (when proc (message "slime-net-connect succeeded...") (slime-init-connection proc))) (when-let (proc (slime-net-connect "localhost" port)) (message "slime-net-connect succeeded...") (slime-init-c onnection proc)) # bind (kill-old-p port host) slime-connect("localhost" 1219) # bind (port) (let ((port ...)) (message "srpac: port read in file: %d" port) (slime-connect "localhost" port)) (cond ((file-exists-p ...) (let ... ... ...)) ((and ... ...) (message "Failed to connect to Swank.")) (t (if . .. ...) (setq slime-connect-retry-timer ...))) # bind (G66513 G66512 G66511) (lambda (G66511 G66512 G66513) (if (active-minibuffer-window) nil (message "Polling %S.. (Abort with `M-x slim e-connection-abort'.)" ...)) (setq slime-state-name (format "[polling:%S]" ...)) (if slime-connect-retry-timer ( cancel-timer slime-connect-retry-timer)) (setq slime-connect-retry-timer nil) (cond (... ...) (... ...) (t ... . ..)))(--G66505-- --attempt-- --retries--) apply((lambda (G66511 G66512 G66513) (if (active-minibuffer-window) nil (message "Polling %S.. (Abort with `M- x slime-connection-abort'.)" ...)) (setq slime-state-name (format "[polling:%S]" ...)) (if slime-connect-retry-t imer (cancel-timer slime-connect-retry-timer)) (setq slime-connect-retry-timer nil) (cond (... ...) (... ...) (t ... ...))) --G66505-- --attempt-- --retries-- nil) # bind (--cl-rest--) (lambda (&rest --cl-rest--) "\nCommon Lisp lambda list:\n (cl-none . NIL)\n\n" (apply (quote ...) (quote --G6 6505--) (quote --attempt--) (quote --retries--) --cl-rest--))() apply((lambda (&rest --cl-rest--) "\nCommon Lisp lambda list:\n (cl-none . NIL)\n\n" (apply (quote ...) (quot e --G66505--) (quote --attempt--) (quote --retries--) --cl-rest--)) nil) # bind (time-elapsed itimers itimer next-wakeup last-event-time this-command inhibit-quit quit-flag current-it imer) # (unwind-protect ...) # bind (match-data) byte-code("..." [this-command inhibit-quit quit-flag match-data itimer current-itimer match-data ((store-match -data match-data)) nil itimer-uses-arguments apply itimer-function itimer-function-arguments last-event-time nex t-wakeup itimers time-elapsed] 5) # (condition-case ... . ((error (byte-code "ÂÃÄ !!#" ... 5)) (quit (byte-code "ÁÂ!"" ... 4)))) # (unwind-protect ...) # bind (itimers itimer next-wakeup idle-time last-event-time recorded-run-time inhibit-quit time-elapsed) itimer-run-expired-timers(3.000095) # bind (sleep elapsed now itimer-inside-driver inhibit-quit ignored) itimer-timer-driver(nil) # (condition-case ... . error) # (catch top-level ...)
The detailed versions involved :
xemacs -V
XEmacs 21.4 (patch 12) "Portable Code" [Lucid] (i686-pc-linux) of Tue Oct 21 2003 on titan
clisp --version
GNU CLISP 2.32 (2003-12-29) (built 3285056062) (memory 3285056598) Software: GNU C 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice) Programme en ANSI C Features: (ASDF MK-DEFSYSTEM COMMON-LISP-CONTROLLER CLX-ANSI-COMMON-LISP CLX SYSCALLS CLOS LOOP COMPILER CLISP ANSI-CL COMMON-LISP LISP=CL INTERPRETER SOCKETS GENERIC-STREAMS LOGICAL-PATHNAMES SCREEN FFI GETTEXT UNICODE BASE-CHAR=CHARACTER PC386 UNIX) Installation directory: /usr/lib/clisp/ User language: ENGLISH Machine: I686(I686)titan.si.c-s.fr [172.17.90.32] (build 2.32-r1 from gentoo)
System: IBM T20 (PIII 700), gentoo 1.4
Tanks in advance for any help, and for this otherwise already very functional piece of work.
Stephane Perrot
------------------------------------------
Faites un voeu et puis Voila ! www.voila.fr
s.perrot@voila.fr writes:
The first invocation of M-x slime RET in a just started XEmacs freezes it
the following sequences of evaluated forms freeze it as weel :
(slime-maybe-start-lisp) (slime-read-port-and-connect) or (slime-maybe-start-lisp) (slime-start-swank-server) ;; eval only once ! (setq port (slime-read-swank-port)) (slime-connect "localhost" port)
I cannot reproduce this problem. I tried XEmacs 21.1, XEmacs 21.4, Emacs 20.7 and Emacs 21.3 with CLISP 2.32. I invoke CLISP with 'clisp -K full' and that seems work without problems.
What do mean with 'freezes'? 'freeze' as in "Emacs does not respond, but C-g works" or "Emacs does not respond and I have to kill Emacs entirely"?
C-g is supposed to work. It would be serious bug in SLIME if it were otherwise.
but NOT the following
(slime-maybe-start-lisp) (slime-start-swank-server) (setq *proc* (slime-net-connect "localhost" port)) (slime-init-connection *proc*) ^^^^
| What's the value of 'port' here? -------------+
SLIME uses a different/random port for each connection, so it is bit surprising that you can connect after restarting the server.
which works fine (i.e. after evaluating a few more forms I get a fully functional SLIME)
In all cases, the lisp is started ok, as is the swank server. The problem seems to me to be located somewhere in the slime-init-connection/slime-net-connect interaction.
Judging from the backtrace, it seems that Emacs can connect, but apparently CLISP doesn't reply to the first request. The first request is usually (swank:getpid).
I have no idea what might cause the problem and can only the give the lame re-compile-everything advice :-) Make sure you have a link to the metering package as described in swank-clisp.lisp and remove all byte-compiled .elc files. Add
(setq swank::*redirect-io* nil) (setq swank::*use-dedicated-output-stream* nil) (setq swank::*log-events* t) (setq swank::*sldb-initial-frames* 1)
to your ~/.swank.lisp for better debugging messages. You can also try to run clisp in a separate xterm, start the swank server with:
(load "swank-loader") (swank:create-swank-server)
and use M-x slime-connect to connect to it.
Helmut.
Hi
I seem to have the same problem.
I have GNU Emacs 21.2.1, SBCL 0.8.7 and I am using Redhat 9
Helmut Eller wrote:
What do mean with 'freezes'? 'freeze' as in "Emacs does not respond, but C-g works" or "Emacs does not respond and I have to kill Emacs entirely"? C-g is supposed to work. It would be serious bug in SLIME if it were otherwise.
Yes, C-g works, and Emacs behaves normally after that.
I have no idea what might cause the problem and can only the give the lame re-compile-everything advice :-) Make sure you have a link to the metering package as described in swank-clisp.lisp and remove all byte-compiled .elc files. Add
(setq swank::*redirect-io* nil) (setq swank::*use-dedicated-output-stream* nil) (setq swank::*log-events* t) (setq swank::*sldb-initial-frames* 1)
I have tried this, but it still fails.
Here is the error messages I got:
[.. SNIP ..]
compilation aborted because of input error: READ failure in COMPILE-FILE: READER-ERROR at 3154 (line 100, column 19) on #<FILE-STREAM for "file "/home/goblin/lisp/libraries/slime/swank-sbcl.lisp"" {9BE2241}>: Symbol "FCNTL" not found in the SB-POSIX package.
[.. SNIP ..]
; compilation unit finished ; caught 1 fatal ERROR condition ; caught 4 STYLE-WARNING conditions ; printed 7 notes WARNING: These Swank interfaces are unimplemented: (ADD-INPUT-HANDLER ARGLIST-STRING BACKTRACE CALL-WITH-COMPILATION-HOOKS [.. SNIP ..] WHO-SETS WHO-SPECIALIZES) T * ;; Swank started at port: 34790.
debugger invoked on a UNDEFINED-FUNCTION in thread 4774: The function SWANK::ACCEPT is undefined.
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 ] Reduce debugger level (leaving debugger, returning to toplevel). 1: [TOPLEVEL] Restart at toplevel READ/EVAL/PRINT loop. (SB-KERNEL::UNDEFINED-FUN-ERROR-HANDLER 4 #<unavailable argument> #.(SB-SYS:INT-SAP #X40259A00) #<SB-ALIEN-INTERNALS:ALIEN-VALUE :SAP #X40259700 :TYPE (* (STRUCT
SB-VM::OS-CONTEXT-T-STRUCT))> (14))[:EXTERNAL] 0]
Peter Mechlenborg metch@daimi.au.dk writes:
compilation aborted because of input error: READ failure in COMPILE-FILE: READER-ERROR at 3154 (line 100, column 19) on #<FILE-STREAM for "file "/home/goblin/lisp/libraries/slime/swank-sbcl.lisp"" {9BE2241}>: Symbol "FCNTL" not found in the SB-POSIX package.
[This is unrelated to the CLISP problem.]
SLIME uses fcntl(2) to enable SIGIO for the socket. The binding for fcntl is only available in newer SBCL versions (0.8.7.36 and above).
I patched SLIME to use our own version of fcntl if the function doesn't exist it the sb-posix package. The CVS version of SLIME should now work with not so new SBCL versions, at least on Linux.
Helmut.