Thibault Langlois wrote: >Thibault Langlois <tl <at> di.fc.ul.pt> writes: > > > >This following function actually saves a core file: >(defun shutdown () > (mp:process-interrupt > (first (last (mp:all-processes))) > #'(lambda () (extensions:save-lisp "/mnt/ldisk1/worlds/last.core"))) > (quit)) > >but then I get an error when I try to use this core: > >$ /usr/local/cmucl-19a/bin/lisp -core /mnt/ldisk1/worlds/last.core >Help! 12 nested errors. KERNEL:*MAXIMUM-ERROR-DEPTH* exceeded. > > Just on principle you should check whatever global state gets set on initialization, both by cmucl (dynamic variables in MP) and by slime (flags telling slime that connections are open etc.) These things need to be set to nil or deleted before you save core. Look at the stuff that saves cores during compilation in the CMUCL source for hints. One easy way to get partway there would be to delete the SWANK package from your image before you call save-lisp. You are going to exit anyway, so you don't need the communication. A more tidy way that might still work would be to call SLIME-DISCONNECT or whatever the function is called in emacs. I don't know if this will get you to a sane baseline state. Also look into usage and implementation of SAVE-LISP for hooks that get called upon startup of the new image. If you are unable to clean up before the core gets saved, there is a hook that you might use to clean up just as the new core gets started.
P.S: I've just started using Thunderbird for mail. Please tell me if I've got something misconfigured. The stuff I'm typing here comes out flowed in a variable-width font, despite my best effort to tell it to be as plain as possible.
