emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#19621: closed (Unbuffered custom binary input port


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#19621: closed (Unbuffered custom binary input ports crash)
Date: Sun, 18 Jan 2015 21:09:03 +0000

Your message dated Sun, 18 Jan 2015 22:08:02 +0100
with message-id <address@hidden>
and subject line Re: bug#19621: Unbuffered custom binary input ports crash
has caused the debbugs.gnu.org bug report #19621,
regarding Unbuffered custom binary input ports crash
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
19621: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19621
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Unbuffered custom binary input ports crash Date: Sun, 18 Jan 2015 21:22:48 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
This is a followup to <http://bugs.gnu.org/19610>.

address@hidden (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’.



--- End Message ---
--- Begin Message --- Subject: Re: bug#19621: Unbuffered custom binary input ports crash Date: Sun, 18 Jan 2015 22:08:02 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
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’.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]