[Openmcl-devel] Bug when writing to broken pipe?
Andreas Thiele
andreas at atp-media.de
Mon Dec 1 04:34:55 PST 2014
Sorry, I found a fix. Just wrap the code within ignore-errors (or similar).
Regards
Andreas
Von: Openmcl-devel [mailto:openmcl-devel-bounces at clozure.com] Im Auftrag von
Andreas Thiele
Gesendet: Montag, 1. Dezember 2014 12:42
An: openmcl-devel at clozure.com
Betreff: [Openmcl-devel] Bug when writing to broken pipe?
Dear All,
I came across a tiny problem which I would consider a bug: I write a lengthy
output to *standard-output* on a Debian Linux. When I pipe the output to
another linux program and the pipe get broken, closure lisp crashes. Is this
behavior correct? If so, how can I avoid the crash.
In my case I pipe to linux less and terminate less by pressed letter q very
soon.
My test code is:
(defun test ()
(loop :for i :from 1 :to 10000 :do
(format t "This is a test line to produce a lengthy output.~%")))
(ccl:save-application "test"
:toplevel-function #'test
:error-handler :quit
:prepend-kernel t)
Tested with ccl-1.9 32 and 64 and ccl-1.10 32-bit.
fwgz at fwgz14:~/cvsrep-bug$test | less
and pressing 'q' very soon leads to
> While executing: #<CCL::STANDARD-KERNEL-METHOD CCL::STREAM-IO-ERROR
(STREAM T T)>, in process toplevel(2).
> Error: on #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/1) #x18353C96> :
> Broken pipe during write
> While executing: #<CCL::STANDARD-KERNEL-METHOD CCL::STREAM-IO-ERROR
(STREAM T T)>, in process toplevel(2).
> Error: on #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/1) #x18353C96> :
> Broken pipe during write
> While executing: #<CCL::STANDARD-KERNEL-METHOD CCL::STREAM-IO-ERROR
(STREAM T T)>, in process toplevel(2).
> Error: on #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/1) #x18353C96> :
> Broken pipe during write
> While executing: #<CCL::STANDARD-KERNEL-METHOD CCL::STREAM-IO-ERROR
(STREAM T T)>, in process toplevel(2).
> Error: on #<BASIC-CHARACTER-OUTPUT-STREAM UTF-8 (PIPE/1) #x18353C96> :
> Broken pipe during write
> While executing: #<CCL::STANDARD-KERNEL-METHOD CCL::STREAM-IO-ERROR
(STREAM T T)>, in process toplevel(2).
Unrecoverable stack overflow.
? for help
[5134] Clozure CL kernel debugger:
Any hints very welcome.
Best Regards
Andreas Thiele
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20141201/d5f08a97/attachment.htm>
More information about the Openmcl-devel
mailing list