GNU bug report logs - #55093
"split -n K/N <file>" BUG: Last Chunk incomplete if input file >= 262144 bytes

Previous Next

Package: coreutils;

Reported by: Adam Holt <holt <at> unleashkids.org>

Date: Sun, 24 Apr 2022 16:00:02 UTC

Severity: normal

Tags: moreinfo

To reply to this bug, email your comments to 55093 AT debbugs.gnu.org.

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-coreutils <at> gnu.org:
bug#55093; Package coreutils. (Sun, 24 Apr 2022 16:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Adam Holt <holt <at> unleashkids.org>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sun, 24 Apr 2022 16:00:02 GMT) Full text and rfc822 format available.

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

From: Adam Holt <holt <at> unleashkids.org>
To: bug-coreutils <at> gnu.org, Torbjörn Granlund <tg <at> gmplib.org>, 
 Richard Stallman <rms <at> gnu.org>
Subject: "split -n K/N <file>" BUG: Last Chunk incomplete if input file >=
 262144 bytes
Date: Sun, 24 Apr 2022 10:40:01 -0400
[Message part 1 (text/plain, inline)]
Hello !

Where do I report a serious data loss bug with GNU's split command?

Example:

$ dd if=/dev/random of=file bs=262144 count=1    # Create file containing
262144 bytes

$ split -n 1/2 file | wc -c
131072
$ split -n 2/2 file | wc -c
0    # SHOULD BE 131072

split -n 1/3 file | wc -c
87381
split -n 2/3 file | wc -c
87381
split -n 3/3 file | wc -c
0    # SHOULD BE 87382


The Last Chunk is completely missing, as you can see in both above examples.

Additionally, if the input file is larger than 2^18 = 262144 bytes, the
Last Chunk generated by "split -n K/N file" is then truncated (i.e. many
bytes are missing, from the beginning of the Last Chunk).

Here's the version number I'm running:

$ split --version
split (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <
https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Torbjorn Granlund and Richard M. Stallman.


Thanks so much for your help forwarding this to anybody who might be able
to confirm and ideally resolve this for all !

Regards,
Adam

--
https://internet-in-a-box.org
https://twitter.com/internet_in_box
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#55093; Package coreutils. (Sun, 24 Apr 2022 23:15:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Adam Holt <holt <at> unleashkids.org>
Cc: 55093 <at> debbugs.gnu.org
Subject: Re: bug#55093: "split -n K/N <file>" BUG: Last Chunk incomplete if
 input file >= 262144 bytes
Date: Sun, 24 Apr 2022 16:14:24 -0700
On 4/24/22 07:40, Adam Holt wrote:

> split (GNU coreutils) 8.32

That's an old version, dated 2020. Please try the current version 
coreutils 9.1, which has bug fixes in this area.

Also, there's no need to cc. rms and tg; they're not working on 'split' 
any more.

Thanks.




Added tag(s) moreinfo. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Sun, 24 Apr 2022 23:15:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#55093; Package coreutils. (Mon, 25 Apr 2022 01:08:03 GMT) Full text and rfc822 format available.

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

From: Adam Holt <holt <at> unleashkids.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 55093 <at> debbugs.gnu.org
Subject: Re: bug#55093: "split -n K/N <file>" BUG: Last Chunk incomplete if
 input file >= 262144 bytes
Date: Sun, 24 Apr 2022 19:59:11 -0400
[Message part 1 (text/plain, inline)]
On Sun, Apr 24, 2022 at 7:14 PM Paul Eggert <eggert <at> cs.ucla.edu> wrote:

> On 4/24/22 07:40, Adam Holt wrote:
>
> > split (GNU coreutils) 8.32
>
> That's an old version, dated 2020. Please try the current version
> coreutils 9.1, which has bug fixes in this area.


Wow, coreutils 9.1 indeed fixes this data loss issue with "split -n K/N",
Thanks Paul!

--
https://internet-in-a-box.org
https://twitter.com/internet_in_box
[Message part 2 (text/html, inline)]

This bug report was last modified 3 years and 142 days ago.

Previous Next


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