GNU bug report logs - #19621
Unbuffered custom binary input ports crash

Previous Next

Package: guile;

Reported by: ludo <at> gnu.org (Ludovic Courtès)

Date: Sun, 18 Jan 2015 20:24:02 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19621 in the body.
You can then email your comments to 19621 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#19621; Package guile. (Sun, 18 Jan 2015 20:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to ludo <at> gnu.org (Ludovic Courtès):
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Sun, 18 Jan 2015 20:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: bug-guile <at> gnu.org
Cc: Mark H Weaver <mhw <at> netris.org>, 19610 <at> debbugs.gnu.org
Subject: Unbuffered custom binary input ports crash
Date: Sun, 18 Jan 2015 21:22:48 +0100
This is a followup to <http://bugs.gnu.org/19610>.

ludo <at> 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’.




Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Sun, 18 Jan 2015 21:09:03 GMT) Full text and rfc822 format available.

Notification sent to ludo <at> gnu.org (Ludovic Courtès):
bug acknowledged by developer. (Sun, 18 Jan 2015 21:09:03 GMT) Full text and rfc822 format available.

Message #10 received at 19621-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: 19621-done <at> debbugs.gnu.org
Cc: Mark H Weaver <mhw <at> netris.org>, 19610 <at> debbugs.gnu.org
Subject: Re: bug#19621: Unbuffered custom binary input ports crash
Date: Sun, 18 Jan 2015 22:08:02 +0100
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’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 16 Feb 2015 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 72 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.