[Openmcl-devel] Problem with read-sequence on binary streams

Gary Byers gb at clozure.com
Wed Jun 11 11:23:54 PDT 2008



On Wed, 11 Jun 2008, p2.edoc at googlemail.com wrote:

> I wondered if it should be (read-byte stream nil :eof)
> but then there are plenty of other (read-byte stream) calls that seem
> to anticipate EOF conditions return :eof.
>

I found a total of 3 such calls: the one that Wade ran into in the
STREAM-READ-VECTOR method on BINARY-INPUT-STREAM, another
in the STREAM-READ-LIST method on BINARY-INPUT-STREAM, and ... well,
there were apparently two identical copies of the STREAM-READ-VECTOR
method in l1-streams.lisp.  Those cases should be fixed in svn as
of <http://trac.clozure.com/openmcl/changeset/9730>,

Did I miss others ?

> At 7:49 AM -0400 08/06/11, Bill St. Clair wrote:
>> The difference, in case anyone, like me, didn't notice it at first
>> blush, is changing "read-byte" to "stream-read-byte".
>>
>> -Bill
>>
>> On Tue, Jun 10, 2008 at 9:42 PM, Wade Humeniuk
>> <wade.humeniuk at gmail.com> wrote:
>>>  Through using Drakma I believe I have a found a bug for
>>> stream-read-vector for
>>>  binary streams.  The problem thread can be found on the drakma-devel
>>>  mailing list
>>>
>>>  http://common-lisp.net/pipermail/drakma-devel/2008-June/000314.html
>>>
>>>  The routine is in ./cct/level-1/l1-streams.lisp
>>>
>>>  the method
>>>
>>>  (defmethod stream-read-vector ((stream binary-input-stream)
>>>                                vector start end)
>>>   (declare (fixnum start end))
>>>   (do* ((i start (1+ i)))
>>>        ((= i end) end)
>>>     (declare (fixnum i))
>> >    (let* ((b (read-byte stream)))
>>>       (if (eq b :eof)
>>>         (return i)
>>>         (setf (uvref vector i) b)))))
>>>
>>>  probably should be changed to...
>>>
>>>  (defmethod stream-read-vector ((stream binary-input-stream)
>>>                                vector start end)
>>>   (declare (fixnum start end))
>>>   (do* ((i start (1+ i)))
>>>        ((= i end) end)
>>>     (declare (fixnum i))
>>>     (let* ((b (stream-read-byte stream)))
>>>       (if (eq b :eof)
>>>         (return i)
>> >        (setf (uvref vector i) b)))))
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list