[Openmcl-devel] Bug when writing to broken pipe?
Gary Byers
gb at clozure.com
Wed Dec 3 12:35:34 PST 2014
i haven't looked at this or even thought about it much yet, but my
first reaction - which could be misguided - is to suggest running the
saved image with the --batch option. That should cause any unhandled
error to abruptly terminate the application and may (I don't remember
the details) cause *TERMINAL-IO* to be initialized differently, and I
expect that the death spiral you're getting has to do with the fact
that the initial thread is trying to FORCE-OUTPUT on the output side of
*TERMINAL-IO*, which is ordinarily the same stream as *STANDARD-OUTPUT*
...
On 12/01/2014 04:42:23 AM, Andreas Thiele wrote:
> 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
>
>
>
>
>
>
>
>
------quoted attachment------
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> https://lists.clozure.com/mailman/listinfo/openmcl-devel
>
More information about the Openmcl-devel
mailing list