[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] Re: Seg fault in write-string.11
From: |
Sam Steingold |
Subject: |
[Gcl-devel] Re: Seg fault in write-string.11 |
Date: |
Mon, 23 Feb 2004 18:07:07 -0500 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (windows-nt) |
> * Camm Maguire <address@hidden> [2004-02-23 11:34:42 -0500]:
>
> What is happening here is that you are creating a stream loop, as
> *standard-input* in GCL eval's to a synonym stream to *terminal-io*.
in CLISP *standard-input* also evaluates to
#<IO SYNONYM-STREAM *TERMINAL-IO*>
nevertheless the test apparently passes:
(with-output-to-string (os)
(let ((*terminal-io* (make-two-way-stream *standard-input* os)))
(write-string "951" t)
(close *terminal-io*)))
==> "951"
I see no problem with the code as long as you do not try to read from
*TERMINAL-IO* bound to that TWO-WAY-STREAM (which will cause a loop in
both CLISP and GCL).
> I was wondering whether this was a proper initial value for
> *standard-input* and checked the spec -- apparently this arrangement
> is specifically allowed.
indeed.
> The code below overruns the C stack as it
> endlessly recurses trying to close *terminal-io*.
closing a TWO-WAY-STREAM should not recurse.
--
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Two wrongs don't make a right, but three rights make a left.