GNU bug report logs -
#64540
[PATCH] od: exit out on failure to write to stdout
Previous Next
Reported by: Josef Bacik <josef <at> toxicpanda.com>
Date: Sun, 9 Jul 2023 09:09:02 UTC
Severity: normal
Tags: patch
Done: Pádraig Brady <P <at> draigBrady.com>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 64540 <at> debbugs.gnu.org (full text, mbox):
On 2023-07-08 15:43, Josef Bacik wrote:
> A very weird bug was uncovered when using fstests with github actions.
> In fstests we are doing something like this
>
> od /dev/urandom | dd of=somefile bs=1M count=10
>
> The above works fine, except in the case of github actions which runs
> this script remotely, capturing the output in a pipe to print on their
> console. Somehow od ends up writing forever into the stdout pipe
> without exiting in this scenario, normally it doesn't do this.
Do you see the same problem if you use 'cat' rather than 'od'? If so,
the problem isn't with 'od'; it's with the environment, which is somehow
set up to ignore SIGPIPE. It shouldn't do that, as ignoring SIGPIPE
breaks a lot of programs, and 'od' would be just one of them.
Although the patch you sent is probably harmless, it's not clear that we
should go through all the GNU utilities and make them check for I/O
errors on every output, as that'd be a maintenance hassle and in some
cases would hurt performance significantly.
This bug report was last modified 1 year and 304 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.