Skip to content

many utilities exit 0 when a warning can't be written to stderr #16646

Open

Description

@sylvestre

When a warning or debug message can't be written to stderr, uutils exits 0. GNU 9.12 exits 1 (2 for sort).

$ printf x y 2>/dev/full; echo $?
command, stderr to /dev/full uutils GNU 9.12
printf x y 0 1
od -w3 /etc/hostname 0 1
numfmt --debug 42 0 1
date --debug -d tomorrow 0 1
tail -n1 --retry somefile 0 1
cksum --debug /etc/hostname 0 1
wc -l --debug /etc/hostname 0 1
sort --debug /etc/hostname 0 2

Related: du -s --max-depth=0 /etc/hostname fails with du: summarizing conflicts with --max-depth=0 (exit 1), GNU only warns du: warning: summarizing is the same as using --max-depth=0 and exits 0.

GNU test: bash util/build-gnu.sh && bash util/run-gnu-test.sh tests/misc/warning-errors.sh

Part of #14705

Activity

  1. Sahil-Gulihar commented on Nov 17, 2026

    @Sahil-Gulihar

    Hi, I'd like to take this one. I'll start with the utilities in the table, making a failed write of a warning/debug message to stderr set exit status 1 (2 for sort), with tests using /dev/full. I'll keep it to small PRs so they're easy to review. Could I be assigned?

  2. oech3 commented on Nov 18, 2026

    @oech3
    Contributor

    Note that GNU ignores write error for stder at most utils and this issue is mentioning rare cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions