From: Giorgos Keramidas
Subject: SLIME on FreeBSD/i386 with CMUCL
Date: 
Message-ID: <86r77xn5t7.fsf@flame.pc>
Hi all,

I recently tried running SLIME in Emacs 21.X and the CVS version
of Emacs, on my FreeBSD/i386 system at home, but stumbled upon a
minor annoyance, which I thought I'd share my workaround for, in
case someone else finds it useful too or someone notices
something evil/wrong with what I did :-)

Slime loads file with M-x load-library slime RET, but when I try
to run it using CMUCL 19b built straight out of the FreeBSD ports
collection, I get an error like this one:

: ; Loading #P"/home/giorgos/init.lisp".
: CMU Common Lisp 19b (19B), running on gothmog.gr
: With core: /usr/local/lib/cmucl/lib/lisp.core
: Dumped on: Mon, 2005-06-27 21:45:53+03:00 on snapdragon.csl.sri.com
: Send questions and bug reports to your local CMUCL maintainer,
: or see <http://www.cons.org/cmucl/support.html>.
: Loaded subsystems:
:     Python 1.1, target Intel x86
:     CLOS based on Gerd's PCL 2004/04/14 03:32:47
: *
: ; Loading #P"/home/giorgos/opt/share/emacs/site-lisp/slime/swank-loader.lisp".
:
: ; Python version 1.1, VM version Intel x86 on 28 DEC 05 06:54:44 am.
: ; Compiling: /home/giorgos/opt/share/emacs/site-lisp/slime/swank-backend.lisp 08 DEC 05 01:21:53 am
:
: ; [GC threshold exceeded with 12,025,192 bytes in use.  Commencing GC.]
: ; [GC completed with 1,337,528 bytes retained and 10,687,664 bytes freed.]
: ; [GC will next occur when at least 13,337,528 bytes are in use.]
: ; [GC threshold exceeded with 13,353,256 bytes in use.  Commencing GC.]
: Help! 12 nested errors.  KERNEL:*MAXIMUM-ERROR-DEPTH* exceeded.
:
: Debug  (type H for help)
:
: (UNIX::SIGSEGV-HANDLER #<unused-arg> #<unused-arg> #.(SYSTEM:INT-SAP #x47FD5D88))
:
:
: Error in function UNIX::SIGSEGV-HANDLER:  Segmentation Violation at #x1003D704.
:    [Condition of type SIMPLE-ERROR]
:
: Restarts:
:   0: [CONTINUE] Return NIL from load of "/home/giorgos/opt/share/emacs/site-lisp/slime/swank-loader.lisp".
:   1: [ABORT   ] Return to Top-Level.
:
: Debug  (type H for help)
:
: (UNIX::SIGSEGV-HANDLER #<unused-arg>
:                        #<unused-arg>
:                        #.(SYSTEM:INT-SAP #x47FD2240))
: Source: Error finding source:
: Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM:  Source file no longer exists:
:   target:code/signal.lisp.
: 0]

Apparently, SLIME compiles a lot of stuff the first time it runs,
but I'm not sure why this throws a SIGSEGV.  Disabling the
garbage collector temporarily allows SLIME to complete its work
at least once, and then compiled code loads fine from ~/.slime
for all subsequent runs.

The steps I had to take were:

- Set inferior-lisp to "lisp -core /home/giorgos/lispcore" in
  my ~/.emacs file:

      (setq inferior-lisp "lisp -core /home/giorgos/lispcore")

- Manually start CMUCL outside of Emacs and disable the
  garbage collector temporarily, saving the LISP core at the
  path shown above:

      ·······@gothmog:/home/giorgos$ lisp
      ; Loading #P"/home/giorgos/init.lisp".
      CMU Common Lisp 19b (19B), running on gothmog.gr
      With core: /usr/local/lib/cmucl/lib/lisp.core
      Dumped on: Mon, 2005-06-27 21:45:53+03:00 on snapdragon.csl.sri.com
      Send questions and bug reports to your local CMUCL maintainer,
      or see <http://www.cons.org/cmucl/support.html>.
      Loaded subsystems:
          Python 1.1, target Intel x86
          CLOS based on Gerd's PCL 2004/04/14 03:32:47
      * (gc-off)

      NIL
      * (save-lisp "lispcore")
      [Doing purification: Done.]
      [Undoing binding stack... done]
      [Saving current lisp image into lispcore:
      Writing 20575664 bytes from the Read-Only space at 0x10000000.
      Writing 2878112 bytes from the Static space at 0x28F00000.
      Writing 4096 bytes from the Dynamic space at 0x48000000.
      done.]
      ·······@gothmog:/home/giorgos$

- Start SLIME from within Emacs and let it complete the
  compilation phase of its first load/run.

- Reset inferior-lisp to just "lisp" in my ~/.emacs file.

Then SLIME runs fine in CMUCL; at least as far as I can tell
until now.