GNU bug report logs - #31528
patch get-bytevector-n to read more than 4 GB

Previous Next

Package: guile;

Reported by: Jan Šmydke <jan.smydke <at> gmail.com>

Date: Sat, 19 May 2018 15:26:01 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 31528 in the body.
You can then email your comments to 31528 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#31528; Package guile. (Sat, 19 May 2018 15:26:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Šmydke <jan.smydke <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Sat, 19 May 2018 15:26:02 GMT) Full text and rfc822 format available.

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

From: Jan Šmydke <jan.smydke <at> gmail.com>
To: bug-guile <at> gnu.org
Subject: patch get-bytevector-n to read more than 4 GB
Date: Sat, 19 May 2018 13:10:15 +0200
[Message part 1 (text/plain, inline)]
Hi,

I found

(use-modules (rnrs io ports))

(define v (call-with-input-file "EIVE01.DAT" (lambda (port)
>
  (get-bytevector-n port (* 5 1024 1024 1024)))))
>

fails due to 'out of range':

ERROR: In procedure get-bytevector-n:

ERROR: Value out of range 0 to 4294967295: 52434042880


 The "count" variable was of "unsigned" type (i.e. 32-bit) so I changed it
to "size_t" and the problem is solved.

Enclosed is the corresponding patch (using format-patch)

Jan Šmydke
[Message part 2 (text/html, inline)]
[patch (application/octet-stream, attachment)]

Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Mon, 18 Jun 2018 12:06:01 GMT) Full text and rfc822 format available.

Notification sent to Jan Šmydke <jan.smydke <at> gmail.com>:
bug acknowledged by developer. (Mon, 18 Jun 2018 12:06:02 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Jan Šmydke <jan.smydke <at> gmail.com>
Cc: 31528-done <at> debbugs.gnu.org
Subject: Re: bug#31528: patch get-bytevector-n to read more than 4 GB
Date: Mon, 18 Jun 2018 14:05:16 +0200
Hello Jan,

Jan Šmydke <jan.smydke <at> gmail.com> skribis:

>  The "count" variable was of "unsigned" type (i.e. 32-bit) so I changed it
> to "size_t" and the problem is solved.
>
> Enclosed is the corresponding patch (using format-patch)
>
> Jan Šmydke
> From 5b72b9d9c3cfa40884594eb1d403ec1d2f477d37 Mon Sep 17 00:00:00 2001
> From: Jan Smydke <jan.smydke <at> gmail.com>
> Date: Sat, 19 May 2018 12:48:01 +0200
> Subject: [PATCH] get-bytevector-n and get-bytevector-n! can now read more than
>  4 GB: var "count" changed from unsigned to size_t
>
> ---
>  libguile/r6rs-ports.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

Awesome.  I adjusted the commit log to match our conventions and
committed.

Thank you!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 17 Jul 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 67 days ago.

Previous Next


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