Debian Bug report logs - #1037275
dd: regression - posix expression syntax no longer supported

version graph

Package: coreutils; Maintainer for coreutils is Michael Stone <[email protected]>; Source for coreutils is src:coreutils (PTS, buildd, popcon).

Reported by: Marc Lehmann <[email protected]>

Date: Sat, 10 Jun 2023 01:48:02 UTC

Severity: normal

Found in version coreutils/9.1-1

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Michael Stone <[email protected]>:
Bug#1037275; Package coreutils. (Sat, 10 Jun 2023 01:48:04 GMT) (full text, mbox, link).


Acknowledgement sent to Marc Lehmann <[email protected]>:
New Bug report received and forwarded. Copy sent to Michael Stone <[email protected]>. (Sat, 10 Jun 2023 01:48:04 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Marc Lehmann <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: dd: regression - posix expression syntax no longer supported
Date: Sat, 10 Jun 2023 03:45:22 +0200
Package: coreutils
Version: 9.1-1
Severity: normal

Dear Maintainer,

I have a script that was used for some decades on multiple
unices. Beginning with bookworm, it stopped working because dd no longer
understands POSIX expression syntax for bs=:

   $ dd if=... bs=1024x1024x32
   dd: invalid number: ‘1024x1024x32’

This should be valid syntax according to POSIX, and was understood on
older versions of Debian GNU/Linux:

   Two or more positive decimal numbers (with or without k or b) separated by x, specifying the product of the indicated values

-- System Information:
Debian Release: 12.0
  APT prefers testing-security
  APT policy: (990, 'testing-security'), (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'stable-debug'), (500, 'unstable'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, x32

Kernel: Linux 6.1.32-schmorp (SMP w/24 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_USER, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages coreutils depends on:
ii  libacl1      2.3.1-3
ii  libattr1     1:2.5.1-4
ii  libc6        2.36-9
ii  libgmp10     2:6.2.1+dfsg1-1.1
ii  libselinux1  3.4-1+b6

coreutils recommends no packages.

coreutils suggests no packages.

-- no debconf information

Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#1037275; Package coreutils. (Sat, 10 Jun 2023 13:51:02 GMT) (full text, mbox, link).


Acknowledgement sent to Pádraig Brady <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (Sat, 10 Jun 2023 13:51:02 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Pádraig Brady <[email protected]>
To: Marc Lehmann <[email protected]>, [email protected], Coreutils <[email protected]>
Subject: Re: Bug#1037275: dd: regression - posix expression syntax no longer supported
Date: Sat, 10 Jun 2023 14:49:29 +0100
[Message part 1 (text/plain, inline)]
On 10/06/2023 02:45, Marc Lehmann wrote:
> Package: coreutils
> Version: 9.1-1
> Severity: normal
> 
> Dear Maintainer,
> 
> I have a script that was used for some decades on multiple
> unices. Beginning with bookworm, it stopped working because dd no longer
> understands POSIX expression syntax for bs=:
> 
>     $ dd if=... bs=1024x1024x32
>     dd: invalid number: ‘1024x1024x32’
> 
> This should be valid syntax according to POSIX, and was understood on
> older versions of Debian GNU/Linux:
> 
>     Two or more positive decimal numbers (with or without k or b) separated by x, specifying the product of the indicated values

Yes this was a regression in coreutils 9.1
The patch attached is the proposed upstream fix.

thanks,
Pádraig
[dd-many-multipliers.patch (text/x-patch, attachment)]

Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#1037275; Package coreutils. (Sun, 11 Jun 2023 17:33:03 GMT) (full text, mbox, link).


Acknowledgement sent to Jim Meyering <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (Sun, 11 Jun 2023 17:33:03 GMT) (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: Jim Meyering <[email protected]>
To: Pádraig Brady <[email protected]>
Cc: Marc Lehmann <[email protected]>, [email protected], Coreutils <[email protected]>
Subject: Re: Bug#1037275: dd: regression - posix expression syntax no longer supported
Date: Sun, 11 Jun 2023 10:29:01 -0700
On Sat, Jun 10, 2023 at 6:50 AM Pádraig Brady <[email protected]> wrote:
> On 10/06/2023 02:45, Marc Lehmann wrote:
> > Package: coreutils
> > Version: 9.1-1
> > Severity: normal
> >
> > Dear Maintainer,
> >
> > I have a script that was used for some decades on multiple
> > unices. Beginning with bookworm, it stopped working because dd no longer
> > understands POSIX expression syntax for bs=:
> >
> >     $ dd if=... bs=1024x1024x32
> >     dd: invalid number: ‘1024x1024x32’
> >
> > This should be valid syntax according to POSIX, and was understood on
> > older versions of Debian GNU/Linux:
> >
> >     Two or more positive decimal numbers (with or without k or b) separated by x, specifying the product of the indicated values
>
> Yes this was a regression in coreutils 9.1
> The patch attached is the proposed upstream fix.

Thanks. The patch looks fine.
My only suggestion would be a stylistic one, to change the ">"
comparison to be the equivalent "<" one, i.e., change this:

+      && *suffix == 'B' && (suffix > str && suffix[-1] != 'B'))

to this (also dropping the unnecessary parentheses):

+      && *suffix == 'B' && str < suffix && suffix[-1] != 'B')

Why? Because of the increasing-to-right number-line argument, where
smaller things are visually on the left of larger ones.

Currently, in src/, the uses of space-delimited < and <= outnumber
uses of > and >= by four to one, 1678 to 428.



Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#1037275; Package coreutils. (Sun, 11 Jun 2023 22:15:02 GMT) (full text, mbox, link).


Acknowledgement sent to Pádraig Brady <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (Sun, 11 Jun 2023 22:15:03 GMT) (full text, mbox, link).


Message #20 received at [email protected] (full text, mbox, reply):

From: Pádraig Brady <[email protected]>
To: Jim Meyering <[email protected]>
Cc: Marc Lehmann <[email protected]>, [email protected], Coreutils <[email protected]>
Subject: Re: Bug#1037275: dd: regression - posix expression syntax no longer supported
Date: Sun, 11 Jun 2023 23:13:22 +0100
On 11/06/2023 18:29, Jim Meyering wrote:
> Thanks. The patch looks fine.
> My only suggestion would be a stylistic one, to change the ">"
> comparison to be the equivalent "<" one, i.e., change this:
> 
> +      && *suffix == 'B' && (suffix > str && suffix[-1] != 'B'))
> 
> to this (also dropping the unnecessary parentheses):
> 
> +      && *suffix == 'B' && str < suffix && suffix[-1] != 'B')
> 
> Why? Because of the increasing-to-right number-line argument, where
> smaller things are visually on the left of larger ones.
> 
> Currently, in src/, the uses of space-delimited < and <= outnumber
> uses of > and >= by four to one, 1678 to 428.

Pushed with that adjustment.

thanks
Pádraig



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 08:44:05 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.