[Openmcl-devel] Bug when writing to broken pipe?

Ron Garret ron at flownet.com
Mon Dec 1 10:06:07 PST 2014


This still looks like a CCL bug to me because you specified :error-handler :quit.  My guess is that CCL is trying to write the error message to stdout instead of stderr, so when you pipe stdout and that pipe gets broken, the attempt to write the error message causes another error, which eventually results in a stack overflow.  (I presume that you got more than just the four errors you included in your message.)

I’d file a ticket.

On Dec 1, 2014, at 4:34 AM, Andreas Thiele <andreas at atp-media.de> wrote:

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20141201/474261c5/attachment.htm>


More information about the Openmcl-devel mailing list