Starting multiprocessing without races with SLIME
Sometimes on restarting my saved image with SLIME I get this error:
NIL is not of type MP::BASIC-PROCESS when accessing slot MP:PROCESS-NAME.
[Condition of type SIMPLE-TYPE-ERROR]
[...]
Backtrace:
0: CONDITIONS::CONDITIONS-ERROR (:INVISIBLEP ..)
1: SYSTEM::REQUIRE-IMP (:SWANK-ASDF #P"/amd/saturn/home/saturn/0/fremlin/.slime/fasl/2009-03-09/lispworks-5.1.2-linux-x86/contrib/swank-asdf.ufasl" *MODULES* NIL)
Locals:
SCM:MODULE-NAME = :SWANK-ASDF
PATHNAME = #P"/amd/saturn/home/saturn/0/fremlin/.slime/fasl/2009-03-09/lispworks-5.1.2..
SYSTEM::REGISTRY = *MODULES*
FUNCTION = NIL
2: REQUIRE (:SWANK-ASDF &OPTIONAL #P"/amd/saturn/home/saturn/0/fremlin/.slime/fasl/2009-03-09/lispworks-5.1.2-linux-x86/contrib/swank-asdf.ufasl")
3: SWANK:SWANK-REQUIRE (:SWANK-ASDF &OPTIONAL NIL)
4: SYSTEM::%INVOKE NIL
5: SYSTEM::%EVAL ((SWANK:SWANK-REQUIRE :SWANK-ASDF))
This appears to be some sort of a race between starting multiprocessing
and starting SLIME, and it seems to occur more regularly when the Lisp
image is restarted a couple of times in quick succession.
I built the image with this script. I guess the most important bit is
(save-image (format nil "lispworks-~A" (expt 2 (ceiling (log (log most-positive-fixnum 2) 2))))
:restart-function 'mp:initialize-multiprocessing
:multiprocessing t
:console t
:environment nil)
Is this the wrong way to build a Lispworks for use with SLIME?
Anyway here is the rest of the build script
(load-all-patches)
(load "/usr/share/common-lisp/source/cl-asdf/asdf.lisp")
(load "/usr/share/common-lisp/source/common-lisp-controller/common-lisp-controller.lisp")
(let ((type (lisp-implementation-type))
(version (lisp-implementation-version)))
#+allegro
(progn
(setf type "allegro"))
(setf version (subseq version 0 (position #\Space version)))
(common-lisp-controller:init-common-lisp-controller-v4
(format nil "~A-~A-~A"
type
version
(floor (log most-positive-fixnum 2)))))
(defun common-lisp-controller::get-uid ()
0)
(asdf:operate 'asdf:load-op 'flexi-streams)
(load "/usr/share/common-lisp/source/common-lisp-controller/common-lisp-controller.lisp")
(save-image (format nil "lispworks-~A" (expt 2 (ceiling (log (log most-positive-fixnum 2) 2))))
:restart-function 'mp:initialize-multiprocessing
:multiprocessing t
:console t
:environment nil)
(quit)