GNU bug report logs - #6417
[Bug 591969] Re: dd bs=3G || ubuntu-bug coreutils

Previous Next

Package: coreutils;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Sun, 13 Jun 2010 19:21:02 UTC

Severity: normal

Fixed in version 8.6

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


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

From: Jim Meyering <jim <at> meyering.net>
To: Paul Eggert <eggert <at> CS.UCLA.EDU>
Cc: bug-coreutils <at> gnu.org
Subject: Re: bug#6417: [Bug 591969] Re: dd bs=3G || ubuntu-bug coreutils
Date: Mon, 14 Jun 2010 22:35:59 +0200
Paul Eggert wrote:
> On 06/13/2010 12:19 PM, Jim Meyering wrote:
>
>> +  size_t sz = input_blocksize + INPUT_BLOCK_SLOP;
>> +  real_buf = malloc (sz);
>> +  if (!real_buf)
>> +    error (EXIT_FAILURE, 0,
>> +           _("failed to allocate an input buffer of size %s"),
>> +           human_size (sz));
>
> Wouldn't it be better to output the exact buffer size,
> rather than an approximation?  Usually it's better to

Hi Paul,

Thanks for the feedback.

I debated that, but figured that most of the time
people would realize what has gone wrong (number too large).

> output more information, rather than less, to help
> debug problems more precisely.
>
> One way to do this would be to output the same string
> that the user specified: if the user says "bs=3EiB" then

That would be best, but as you see above, it's not the same
number, since what we try to allocate is larger by INPUT_BLOCK_SLOP.

> output "3EiB" in the diagnostic.  That would be exact,
> and would be a bit friendlier than "3458764513820540928 bytes".
> Or, we could output both, as in "3EiB (3458764513820540928 bytes)",
> where the first is the string and the second is the integer that
> we converted it to.

That would be an improvement, indeed.
I've gone ahead and pushed the patch above.
You're welcome to patch further.




This bug report was last modified 14 years and 319 days ago.

Previous Next


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