From: Timofei Shatrov
Subject: CLISP, Gray stream bug
Date: 
Message-ID: <435d06a9.13358397@news.readfreenews.net>
I think I've encountered a bug in CLISP (v. 2.34).

When *outstream* is a Gray stream 

(let ((*standard-output* *outstream*)) (princ "aaaaaa"))

crashes CLISP, while (princ "aaaaaa" *outstream*) works.

The definition of terminal-out, the class that *outstream* is a member
of (although I doubt that matters much).

(defclass terminal-out (gray:fundamental-character-output-stream)
  ((textwidth :initarg textwidth :initform 72 :accessor textwidth)
   (offset :initarg offset :initform 0 :accessor offset)
   (style :initarg style :initform 0 :accessor style)))

(defmethod gray:stream-write-char ((s terminal-out) char)
  (unless (console-running-p) (error "No console is running"))
  (append-text (first *console-on*) (make-string 1 :initial-element
char))
  )

(defmethod gray:stream-line-column ((s terminal-out))
  (offset s))

(defmethod gray:stream-write-char-sequence ((s terminal-out) str
					    &optional start end)
  (unless (console-running-p) (error "No console is running"))
  (append-text (first *console-on*) 
	       (subseq str (if start start 0) (if end end nil))))


-- 
|a\o/r|,-------------.,---------- Timofei Shatrov aka Grue ------------.
| m"a ||FC AMKAR PERM|| mail: grue at mail.ru  http://grue3.tripod.com |
|  k  ||  PWNZ J00   || Kingdom of Loathing: Grue3 lvl 18 Seal Clubber |
`-----'`-------------'`-------------------------------------------[4*72]

From: Sam Steingold
Subject: Re: CLISP, Gray stream bug
Date: 
Message-ID: <uvezmet5x.fsf@gnu.org>
> * Timofei Shatrov <····@znvy.eh> [2005-10-24 16:20:05 +0000]:
>
> I think I've encountered a bug in CLISP (v. 2.34).
>
> When *outstream* is a Gray stream 
>
> (let ((*standard-output* *outstream*)) (princ "aaaaaa"))
>
> crashes CLISP, while (princ "aaaaaa" *outstream*) works.
>
> The definition of terminal-out, the class that *outstream* is a member
> of (although I doubt that matters much).
>
> (defclass terminal-out (gray:fundamental-character-output-stream)
>   ((textwidth :initarg textwidth :initform 72 :accessor textwidth)
>    (offset :initarg offset :initform 0 :accessor offset)
>    (style :initarg style :initform 0 :accessor style)))
>
> (defmethod gray:stream-write-char ((s terminal-out) char)
>   (unless (console-running-p) (error "No console is running"))
>   (append-text (first *console-on*) (make-string 1 :initial-element
> char))
>   )
>
> (defmethod gray:stream-line-column ((s terminal-out))
>   (offset s))
>
> (defmethod gray:stream-write-char-sequence ((s terminal-out) str
> 					    &optional start end)
>   (unless (console-running-p) (error "No console is running"))
>   (append-text (first *console-on*) 
> 	       (subseq str (if start start 0) (if end end nil))))

offset, append-text, console-running-p & *console-on* are not defined.

please submit a self-contained bug report at
<http://sourceforge.net/tracker/?group_id=1355&atid=101355>
please read <http://clisp.cons.org/clisp.html#bugs> first.

thanks.


-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.jihadwatch.org/> <http://www.dhimmi.com/> <http://pmw.org.il/>
<http://www.iris.org.il> <http://www.camera.org> <http://ffii.org/>
Every day above ground is a good day.
From: Timofei Shatrov
Subject: Re: CLISP, Gray stream bug
Date: 
Message-ID: <435d22cf.20565080@news.readfreenews.net>
On Mon, 24 Oct 2005 13:11:54 -0400, Sam Steingold <···@gnu.org> tried to
confuse everyone with this message:


>
>offset, append-text, console-running-p & *console-on* are not defined.
>
>please submit a self-contained bug report at
><http://sourceforge.net/tracker/?group_id=1355&atid=101355>
>please read <http://clisp.cons.org/clisp.html#bugs> first.
>
>thanks.

Just did it (that SourceForge registration was really annoying...). It
crashes even with a really trivial Gray stream.

-- 
|a\o/r|,-------------.,---------- Timofei Shatrov aka Grue ------------.
| m"a ||FC AMKAR PERM|| mail: grue at mail.ru  http://grue3.tripod.com |
|  k  ||  PWNZ J00   || Kingdom of Loathing: Grue3 lvl 18 Seal Clubber |
`-----'`-------------'`-------------------------------------------[4*72]
From: Sam Steingold
Subject: Re: CLISP, Gray stream bug
Date: 
Message-ID: <uhdb33tar.fsf@gnu.org>
> * Timofei Shatrov <····@znvy.eh> [2005-10-24 18:15:49 +0000]:
>
> On Mon, 24 Oct 2005 13:11:54 -0400, Sam Steingold <···@gnu.org> tried to
> confuse everyone with this message:

did I?

>>offset, append-text, console-running-p & *console-on* are not defined.
>>
>>please submit a self-contained bug report at
>><http://sourceforge.net/tracker/?group_id=1355&atid=101355>
>>please read <http://clisp.cons.org/clisp.html#bugs> first.
>>
>>thanks.
>
> Just did it (that SourceForge registration was really annoying...).

thanks - I hope you will keep using CLISP, and, if you do, you might
experience other issues too...

> It crashes even with a really trivial Gray stream.

indeed it does.
you have an infinite recursion there: your write-char method calls
princ, so when *standard-output* is your terminal-stream, write-char
calls princ which calls write-char which calls princ which calls ...
while it would be nice if CLISP exited gracefully here, this is still a
user error.
to make this work, you may have to ensure that the write-char method
does not rely on global variables.

thanks.


-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.mideasttruth.com/> <http://www.openvotingconsortium.org/>
<http://www.dhimmi.com/> <http://www.iris.org.il>
If You Want Breakfast In Bed, Sleep In the Kitchen.
From: Christophe Rhodes
Subject: Re: CLISP, Gray stream bug
Date: 
Message-ID: <sqfyqqc04l.fsf@cam.ac.uk>
····@mail.ru (Timofei Shatrov) writes:

> I think I've encountered a bug in CLISP (v. 2.34).

That may be, and it's possible that clisp maintainers read this
newsgroup, but this is not a terribly sensible place for
implementation-specific bug reports, and you may wish to direct your
report to the right location, which for clisp is (I believe) the
SourceForge bug tracker linked from
<http://www.sourceforge.net/projects/clisp/>.

Christophe