From: Jonathon McKitrick
Subject: Help with saving SBCL image that will connect to SLIME
Date: 
Message-ID: <1136987707.213554.15630@g14g2000cwa.googlegroups.com>
I want to load all the modules, start araneida running in it, and also
start a repl and swank server.  When I do this, and save the image and
restart it, SBCL quits with the error message that initial thread has
invalid number of arguments, or something like that.

I have no problem starting the code, running araneida, starting swank,
and debugging with slime.  But as soon as I try to save this image and
restart it, I run into problems.
----------------------------------------------------------------------------
(in-package :common-lisp-user)

(asdf::oos 'asdf:load-op :rlg-web)

;(in-package :ajax)

(defun rlg-toplevel ()
  (swank:create-server :dont-close t)
  (ajax:run)
  (setf *package* (find-package :common-lisp-user))
  (format t "Done.~%")
  (sb-impl::toplevel-repl)
;  (error "Shouldn't return")
)

;(sb-ext:save-lisp-and-die "rlg.core" :purify t)
(sb-ext:save-lisp-and-die "rlg.core" :toplevel #'rlg-toplevel :purify
t)
----------------------------------------------------------------------------------------------
········@nessus:~/cvs/cl-rlg$ lisp --core rlg.core
This is SBCL 0.9.8, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
;; Swank started at port: 4005.
Patches applied.
Ready.
Done.

debugger invoked on a SB-INT:SIMPLE-PROGRAM-ERROR in thread
#<THREAD "initial thread" {9003429}>:
  invalid number of arguments: 0

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

(no restarts: If you didn't do this on purpose, please report it as a
bug.)

(SB-IMPL::TOPLEVEL-REPL)
0]

debugger invoked on a SIMPLE-ERROR in thread
#<THREAD "initial thread" {9003429}>:
  (#<SB-IMPL::HANDLER INPUT on BOGUS descriptor 7: #>) has a bad file
descriptor
.

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [REMOVE-THEM] Remove bogus handlers.
  1: [RETRY-THEM ] Retry bogus handlers.
  2: [CONTINUE   ] Go on, leaving handlers marked as bogus.

(SB-IMPL::HANDLER-DESCRIPTORS-ERROR)
0[2]

From: Zach Beane
Subject: Re: Help with saving SBCL image that will connect to SLIME
Date: 
Message-ID: <m3u0cadd53.fsf@unnamed.xach.com>
"Jonathon McKitrick" <···········@bigfoot.com> writes:

> I want to load all the modules, start araneida running in it, and also
> start a repl and swank server.  When I do this, and save the image and
> restart it, SBCL quits with the error message that initial thread has
> invalid number of arguments, or something like that.
> 
> I have no problem starting the code, running araneida, starting swank,
> and debugging with slime.  But as soon as I try to save this image and
> restart it, I run into problems.

I don't think you will find a way to restart an image that had open
network connections.

What I generally do is load all the libraries I want, load a package
with code that knows how to "boot" the image (that is, start all
services I want running on restart), then save the image. After I
restart from that saved image, I run the boot function to get
everything back up and running.

Zach
From: rydis (Martin Rydstr|m) @CD.Chalmers.SE
Subject: Re: Help with saving SBCL image that will connect to SLIME
Date: 
Message-ID: <w4coe2e8iha.fsf@boris.cd.chalmers.se>
Zach Beane <····@xach.com> writes:
> What I generally do is load all the libraries I want, load a package
> with code that knows how to "boot" the image (that is, start all
> services I want running on restart), then save the image. After I
> restart from that saved image, I run the boot function to get
> everything back up and running.

You could even SAVE-LISP-AND-DIE with :toplevel #'boot.

',mr

-- 
[Emacs] is written in Lisp, which is the only computer language that is
beautiful.  -- Neal Stephenson, _In the Beginning was the Command Line_