GNU bug report logs -
#45816
(ice-9 suspendable-ports):get-bytevector-some! is broken
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
hi,
(ice-9 suspendable-ports):get-bytevector-some! calls bytevector-copy!
with transfer-size (which is a number) as third argument:
...
(define (get-bytevector-some! port bv start count)
(if (zero? count)
0
(call-with-values (lambda () (fill-input port 1 'binary))
(lambda (buf cur buffered)
(if (zero? buffered)
(begin
(set-port-buffer-has-eof?! buf #f)
the-eof-object)
(let ((transfer-size (min count buffered)))
(bytevector-copy! (port-buffer-bytevector buf) cur
transfer-size start buffered)
(set-port-buffer-cur! buf (+ cur transfer-size))
transfer-size))))))
...
The third argument to bytevector-copy! must be the target bytevector,
from the doc:
Scheme Procedure: bytevector-copy! source source-start target target-start len
Copy len bytes from source into target, starting reading from
source-start (a positive index within source) and start writing at
target-start. It is permitted for the source and target regions to
overlap.
I think the correct call is:
(bytevector-copy! (port-buffer-bytevector buf) cur
bv start transfer-size)
A potentional fix is attached.
If you need any additional information, please let me know.
- d4ryus
[suspendable-get-bytevector-some-fix.patch (text/plain, attachment)]
This bug report was last modified 4 years and 39 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.