GNU bug report logs - #28432
dd: warn about partial read on final iread

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Severity: wishlist; Reported by: Barry Handelman <barry.handelman@HIDDEN>; dated Tue, 12 Sep 2017 15:55:02 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.
Changed bug title to 'dd: warn about partial read on final iread' from 'dd doesn't warn about partial read on final call to iread' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Assaf Gordon <assafgordon@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 28432 <at> debbugs.gnu.org:


Received: (at 28432) by debbugs.gnu.org; 14 Sep 2017 01:11:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 13 21:11:55 2017
Received: from localhost ([127.0.0.1]:39204 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dsIh9-0004B7-3y
	for submit <at> debbugs.gnu.org; Wed, 13 Sep 2017 21:11:55 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:51038)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <P@HIDDEN>) id 1dsIh6-0004Ax-9p
 for 28432 <at> debbugs.gnu.org; Wed, 13 Sep 2017 21:11:52 -0400
Received: from localhost.localdomain (c-73-158-116-184.hsd1.ca.comcast.net
 [73.158.116.184])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 886A24B02;
 Thu, 14 Sep 2017 02:11:50 +0100 (IST)
Subject: Re: bug#28432: dd doesn't warn about partial read on final call to
 iread
To: Barry Handelman <barry.handelman@HIDDEN>, 28432 <at> debbugs.gnu.org
References: <CAD4Br39yrmeU_r9_bfmoHMGC8XkRLdXiuM4M_M5rhRD3d=6k0Q@HIDDEN>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@HIDDEN>
Message-ID: <e825bd60-8c61-2d86-4cba-fd68fc9fabcf@HIDDEN>
Date: Wed, 13 Sep 2017 18:11:48 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <CAD4Br39yrmeU_r9_bfmoHMGC8XkRLdXiuM4M_M5rhRD3d=6k0Q@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 28432
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

On 12/09/17 08:51, Barry Handelman wrote:
> The iread function in dd.c issues a warning if the previous read was short,
> suggesting that you use iflag=fullblock
> 
> However, the warning is issued when the previous call to iread was partial,
> so if only the final read was short then no warning is issued.
> Importantly, this will always be the case when there was only one read, and
> it was partial.
> 
> I'd suggest that if the strategy of warning on subsequent reads is to be
> used, the warning routine should be run once again after the final read.

The current approach was discussed at https://bugs.gnu.org/7362
A short read as the last read would be a common situation though?
You're specifically looking for the following to warn?

  (echo; sleep 1; echo) | dd count=1 bs=512

That may be a bit aggressive as that could be used to read
the current data available, up to a specified max.

cheers,
Pádraig.




Information forwarded to bug-coreutils@HIDDEN:
bug#28432; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 12 Sep 2017 15:54:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 12 11:54:43 2017
Received: from localhost ([127.0.0.1]:36055 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1drnWN-00042g-HP
	for submit <at> debbugs.gnu.org; Tue, 12 Sep 2017 11:54:43 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33705)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <barry.handelman@HIDDEN>) id 1drnTf-0003y0-Rd
 for submit <at> debbugs.gnu.org; Tue, 12 Sep 2017 11:51:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <barry.handelman@HIDDEN>) id 1drnTZ-0005no-8w
 for submit <at> debbugs.gnu.org; Tue, 12 Sep 2017 11:51:50 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM,
 HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:37572)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <barry.handelman@HIDDEN>)
 id 1drnTZ-0005nh-5W
 for submit <at> debbugs.gnu.org; Tue, 12 Sep 2017 11:51:49 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52897)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <barry.handelman@HIDDEN>) id 1drnTX-0006fm-W7
 for bug-coreutils@HIDDEN; Tue, 12 Sep 2017 11:51:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <barry.handelman@HIDDEN>) id 1drnTU-0005ld-6i
 for bug-coreutils@HIDDEN; Tue, 12 Sep 2017 11:51:48 -0400
Received: from mail-wr0-x236.google.com ([2a00:1450:400c:c0c::236]:37150)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <barry.handelman@HIDDEN>)
 id 1drnTU-0005ji-02
 for bug-coreutils@HIDDEN; Tue, 12 Sep 2017 11:51:44 -0400
Received: by mail-wr0-x236.google.com with SMTP id k20so23693488wre.4
 for <bug-coreutils@HIDDEN>; Tue, 12 Sep 2017 08:51:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=2eWxXOJBGCjN12VRZFV4YohFHQ50XNMBGjwvKfs+24g=;
 b=GEyf3OtFmjo6s0EgTfZa5ZvsiRaos6a53HZ/zMcnGZqLJbe6fn6Sy6FSz8UxnFczti
 YpXLS0JnpbUd03MPigkdf0HwXIwQCgQksLqIOsSz6iBQW17suhJln0ND9s4Rs8023h2w
 s2YTeSDC8qznomLayG3uoAssrQbHJJspE90MZ2rX9mqosbYhOtV/w8GTRBXbaMGcbwAY
 VZ3hwtOFwEKawDcWmaYdMEwuQryRTpzJ5puQTUIIXVi3SuBcFRr/qxsgRBGxZQYH4iBZ
 7omyMM1qYGtsxGQJSMMC7TJAL0gNF96F1cgSJH4rhu3r37D/Se6DYdvAZok7qHHwEDm3
 UY0g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=2eWxXOJBGCjN12VRZFV4YohFHQ50XNMBGjwvKfs+24g=;
 b=fE+tdTWxrIntsMLEslCT1o+JSffJe3Pj0bKSCRuC+d0h5SfjLZl6UFtV2+rBgfUjZ+
 CQTjwICfIvLBG8vcm7hoFeOfN7k/T2rVSexfiN5jxDxDifDnzscmIzSoOFAOQuCELDfO
 jYDdcjMEpXaCQb2O/kKczVmUhO597EroetVPMKUysFzPwhLyWOtVkZ18JdHZsF4RvhdB
 ajgbYvi9xsnk5MuNlP+VyD9OlXUbWoJFhW9RAMPluYtGq0x54TbEC+71e6/TGBVZLC7Y
 ARSWww6hb12QdgnsCK/EQzSoGGAPcRyrZ2WToyvjPnLU7BmziNb9BzIIehVZqb3v/bMm
 7r4Q==
X-Gm-Message-State: AHPjjUh5s7bSSwITWDa55izmdl3ip98BRv02W9t1NwunUC3HF95oTlrT
 9IEwal1mTcgbBV2HFrpWHsjcb88bhQ==
X-Google-Smtp-Source: ADKCNb54OXGVfFdlToHyKBZbg+N28VSUxT642PkTGu4liJmjvghv0MxGVbAknxdt1uHiEpQGM2elLYsJNoIx3JgzyLo=
X-Received: by 10.223.172.66 with SMTP id v60mr12662853wrc.143.1505231501158; 
 Tue, 12 Sep 2017 08:51:41 -0700 (PDT)
MIME-Version: 1.0
From: Barry Handelman <barry.handelman@HIDDEN>
Date: Tue, 12 Sep 2017 15:51:30 +0000
Message-ID: <CAD4Br39yrmeU_r9_bfmoHMGC8XkRLdXiuM4M_M5rhRD3d=6k0Q@HIDDEN>
Subject: dd doesn't warn about partial read on final call to iread
To: bug-coreutils@HIDDEN
Content-Type: multipart/alternative; boundary="f403045cf152ee74b705590004c8"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 12 Sep 2017 11:54:41 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

--f403045cf152ee74b705590004c8
Content-Type: text/plain; charset="UTF-8"

The iread function in dd.c issues a warning if the previous read was short,
suggesting that you use iflag=fullblock

However, the warning is issued when the previous call to iread was partial,
so if only the final read was short then no warning is issued.
Importantly, this will always be the case when there was only one read, and
it was partial.

I'd suggest that if the strategy of warning on subsequent reads is to be
used, the warning routine should be run once again after the final read.

--f403045cf152ee74b705590004c8
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>The iread function in dd.c issues a warning if the pr=
evious read was short, suggesting that you use iflag=3Dfullblock<br></div><=
div><br></div><div>However, the warning is issued when the previous call to=
 iread was partial, so if only the final read was short then no warning is =
issued.=C2=A0 Importantly, this will always be the case when there was only=
 one read, and it was partial.</div><div><br></div><div>I&#39;d suggest tha=
t if the strategy of warning on subsequent reads is to be used, the warning=
 routine should be run once again after the final read. =C2=A0</div></div>

--f403045cf152ee74b705590004c8--




Acknowledgement sent to Barry Handelman <barry.handelman@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#28432; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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