[Openmcl-devel] problems with error handling in standalone executables

Didier Verna didier at lrde.epita.fr
Tue Feb 8 06:54:42 PST 2011


  Hello,

it seems that error handling don't work properly in a standalone
executable. This is with CCL Version 1.5-r14647M (LinuxX8632) from svn
trunk.

Consider the file test.lisp as follows:

(defun main ()
  (restart-case (error "This is an intentional error.")
    (let-fall ()
      :report "Let fall"
      nil)))

This session works as expected:

$ ccl --no-init --load /tmp/test.lisp
Welcome to Clozure Common Lisp Version 1.5-r14647M  (LinuxX8632)!
? (main)
> Error: This is an intentional error.
> While executing: MAIN, in process listener(1).
> Type :POP to abort, :R for a list of available restarts.
> Type :? for other options.
1 > :R
>   Type (:C <n>) to invoke one of the following restarts:
0. Return to break level 1.
1. #<RESTART ABORT-BREAK #xB71DF8F6>
2. Let fall
3. Return to toplevel.
4. #<RESTART ABORT-BREAK #xB71DFB86>
5. Reset this thread
6. Kill this thread
1 > (:C 2)
Invoking restart: Let fall
NIL
? 


Now, let's (ccl:save-application "test" 
             :toplevel-function #'main
             :init-file nil
             :prepend-kernel t)

$ ./test
> Error: This is an intentional error.
> While executing: MAIN, in process toplevel(2).

;;;
;;; #<PROCESS toplevel(2) [Active] #x182A9D6E> requires access to Shared Terminal Input
;;; Type (:y 2) to yield control(:y 2)


[ at that point, all I can do is ^C ]


^C to this thread.
;;;
> Break: interrupt signal
> While executing: #<CCL::STANDARD-KERNEL-METHOD PROCESS-INTERRUPT (PROCESS T)>, in process Initial(0).
> Type :GO to continue, :POP to abort, :R for a list of available restarts.
> If continued: Return from BREAK.
> Type :? for other options.
1 > :R
>   Type (:C <n>) to invoke one of the following restarts:
0. Return to break level 1.
1. #<RESTART ABORT-BREAK #xB754BD86>
2. Return from BREAK.
3. #<RESTART ABORT #xB754BF8E>
4. #<RESTART ABORT-BREAK #xB754BFB6>


[ as you can see, my user-defined restart is not available ]


1 > (:C 3)


[ nothing happens ]


^CInvoking restart: #<RESTART ABORT #xB754BF8E>


> Break: interrupt signal
> While executing: #<CCL::STANDARD-KERNEL-METHOD PROCESS-INTERRUPT (PROCESS T)>, in process Initial(0).
> Type :GO to continue, :POP to abort, :R for a list of available restarts.
> If continued: Return from BREAK.
> Type :? for other options.
1 > ^Z
zsh: suspended  ./test
$ kill %1



Finally, note that if you set the error handler to :quit in the call to
save-application, the result is the same (most notably, CCL don't quit).


Thank you !

-- 
Resistance is futile. You will be jazzimilated.

Scientific site:   http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com



More information about the Openmcl-devel mailing list