unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#19610: Unbuffered custom binary input ports crash
       [not found] ` <87h9vr3ddr.fsf@gnu.org>
@ 2015-01-18 20:22   ` Ludovic Courtès
  2015-01-18 21:08     ` bug#19621: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Ludovic Courtès @ 2015-01-18 20:22 UTC (permalink / raw)
  To: bug-guile; +Cc: 19610

This is a followup to <http://bugs.gnu.org/19610>.

ludo@gnu.org (Ludovic Courtès) skribis:

> However, I tested it live, and it aborts like this (this is with Guile
> 2.0.11.109-e1d29 on x86_64-linux-gnu):
>
> retrieving 1 files from 'wildebeest.jxself.org'...
> importing file or directory '/gnu/store/prrwzx5v33miiz5fh8653m1izl5f8d4k-brasero-3.8.0'...
>
> ;;; (sigport #f #<input: r6rs-custom-binary-input-port 1eee0d0>)
> guile: ../../libguile/ports.c:2527: scm_i_port_iconv_descriptors: Assertion `pti->encoding_mode == SCM_PORT_ENCODING_MODE_ICONV' failed.
> builder for `/gnu/store/izjx4wllhcy66nsn9pxbkghaq2cy06qv-brasero-3.8.0.drv' failed due to signal 6 (Aborted)

Here’s a way to reproduce the assertion failure above (with Guile
2.0.11+):

--8<---------------cut here---------------start------------->8---
(use-modules (rnrs io ports))

(define port
  (let ((input (open-input-string (make-string 1000 #\a))))
    (make-custom-binary-input-port "foo"
                                   (lambda (bv index count)
                                     (let ((n (get-bytevector-n! input bv index
                                                                 count)))
                                       (if (eof-object? n)
                                           0
                                           n)))
                                   #f #f
                                   (lambda ()
                                     (close-port input)))))

(setvbuf port _IONBF)
(pk 'e (port-encoding port))
(get-string-all port)
--8<---------------cut here---------------end--------------->8---

Ludo’.





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#19621: Unbuffered custom binary input ports crash
  2015-01-18 20:22   ` bug#19610: Unbuffered custom binary input ports crash Ludovic Courtès
@ 2015-01-18 21:08     ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2015-01-18 21:08 UTC (permalink / raw)
  To: 19621-done; +Cc: 19610

This is fixed by Guile commit ed72201 (it will be in 2.0.12.)

As noted in the message, ‘cbip_fill_input’ would end up writing beyond
the ‘shortbuf’ field, leading to the port’s corruption.

Ludo’.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-18 21:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <8761c7kifr.fsf@netris.org>
     [not found] ` <87h9vr3ddr.fsf@gnu.org>
2015-01-18 20:22   ` bug#19610: Unbuffered custom binary input ports crash Ludovic Courtès
2015-01-18 21:08     ` bug#19621: " Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).