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

Gary Byers gb at clozure.com
Tue Feb 8 11:19:33 PST 2011



On Tue, 8 Feb 2011, Didier Verna wrote:

>
>  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.

Error handling in and of itself seems to work fine, but there seems
to be some confusion over what thread owns the right to read from
the input side of *TERMINAL-IO*.

That seems to be fixed in the trunk and the fix should make it
into the 1.6 release in a few days.  (I suppose that it's possible
that people have standalone applications that work around the
problem in their own ways, but that doesn't seem likely.)  We 
generally don't try to maintain older releases, and at this
point 1.5 is an older release.

>
> 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
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list