[bug #68541] xargs -s VERYLARGE issues diagnostic when POSIX would likely prefer not
James Youngman <[email protected]> Mon, 20 Jul 2026 10:00:27 -0400 (EDT)
| Newsgroups | gmane.comp.gnu.findutils.bugs |
|---|---|
| Message-ID | <[email protected]> |
--8323329-1714636915-1784556027=:1467549
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline
URL:=0A <https://savannah.gnu.org/bugs/?68541>=0A=0A Summa=
ry: xargs -s VERYLARGE issues diagnostic when POSIX=0Awould likely prefer n=
ot=0A Group: findutils=0A Submitter: jay=0A=
Submitted: Mon 20 Jul 2026 02:00:17 PM UTC=0A =
Category: None=0A Severity: 3 - Normal=0A Pr=
iority: 5 - Normal=0A Item Group: None=0A Sta=
tus: None=0A Privacy: Public=0A Assigned to: ja=
y=0A Originator Name:=0A Originator Email:=0A Op=
en/Closed: Open=0A Discussion Lock: Unlocked=0A Rel=
ease: 4.11.0=0A Fixed Release: None=0A=0A=0A _________________=
______________________________________=0A=0AFollow-up Comments:=0A=0A=0A---=
----------------------------------------------------=0ADate: Mon 20 Jul 202=
6 02:00:17 PM UTC By: James Youngman <jay>=0A=0A$ echo 1 | env POSIXLY_COR=
RECT=3D1 xargs -s=0A100000000000000000000000000000000000000000000000 echo=
=0Axargs: value 100000000000000000000000000000000000000000000000 for -s opt=
ion=0Ashould be <=3D 2092931=0A=0A=0AHowever, POSIX specifically says that =
too large a value for -s is not an=0Aerror. The implication is that if th=
is is the only problem with the command=0Aline and there is no other error,=
xargs must exit with status 0. =0A=0ALess clear is whether a ("warning")=
diagnostic is allowed. =0A=0APOSIX utilities are often constrained by t=
he way POSIX sets out the default=0Abehaviour in the STDERR section (see th=
e Shell and Utilities volume of=0APOSIX.1-2024):=0A=0A> Default Behavior: W=
hen this section is listed as "The standard error shall be=0A> used only fo=
r diagnostic messages.", it means that, unless otherwise stated,=0A> the di=
agnostic messages shall be sent to the standard error only when the=0A> exi=
t status indicates that an error occurred and the utility is used as=0A> de=
scribed by this volume of POSIX.1-2024.=0A=0AIn the case of xargs though, t=
he STDERR section doesn't say "The standard=0Aerror shall be used only for =
diagnostic messages." but instead says:=0A=0A> The standard error shall be =
used for diagnostic messages and the -t and -p=0A> options. If the -t optio=
n is specified, the utility and its constructed=0A> argument list shall be =
written to standard error, as it will be invoked,=0A> prior to invocation. =
If -p is specified, a prompt of the following format=0A> shall be written (=
in the POSIX locale): "?..." at the end of the line of the=0A> output from =
-t.=0A=0A=0AI suspect that this means that the combination of a message on =
stderr and an=0Aexit status of 0 would be conforming (even if neither -t no=
r -p were in use).=0A Even though this is likely not what the writer(s) int=
ended for the case where=0Athe argument of "-s" is too large.=0A=0AFor the =
sake of argument, while considering this issue, we could assume that=0Athe =
argument of -s is in excess of some system limit, but still no greater=0Ath=
an 2147483647 (since "Base Definitions" section 12.1 Utility Argument Synta=
x=0Arequires us to recognise such a value as syntactically valid even if it=
=0Aexceeds a limit).=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A __________________=
_____________________________________=0A=0AReply to this item at:=0A=0A <h=
ttps://savannah.gnu.org/bugs/?68541>=0A=0A_________________________________=
______________=0AMessage sent via Savannah=0Ahttps://savannah.gnu.org/=0A
--8323329-1714636915-1784556027=:1467549
Content-Type: APPLICATION/pgp-signature; name=signature.asc
-----BEGIN PGP SIGNATURE-----
iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCal4p+wAKCRCqLAuaBUf3
Tk8ZAP40QiyTLAt+ENQ4dvi647p1fKicj/d8fc6vAEoKhKtivgD/ae3qO7d+5tv8
yotsWYVhmoJwS1BORv6az42+mx6iJQ4=
=vfUN
-----END PGP SIGNATURE-----
--8323329-1714636915-1784556027=:1467549--