GNU bug report logs - #77800
grep-3.12: write-error-msg test failure on fedora rawhide (f43)

Previous Next

Package: grep;

Reported by: Jaroslav Škarvada <jskarvad <at> redhat.com>

Date: Mon, 14 Apr 2025 12:56:01 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #53 received at 77800 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Grisha Levit <grishalevit <at> gmail.com>
Cc: jackson <at> fastmail.fm,
 Jaroslav Škarvada <jskarvad <at> redhat.com>,
 "bug-gnulib <at> gnu.org List" <bug-gnulib <at> gnu.org>,
 Paul Eggert <eggert <at> cs.ucla.edu>, 77800 <at> debbugs.gnu.org
Subject: Re: bug#77800: grep-3.12: write-error-msg test failure on fedora
 rawhide (f43)
Date: Thu, 17 Apr 2025 23:58:40 -0700
On Thu, Apr 17, 2025 at 11:15 PM Grisha Levit <grishalevit <at> gmail.com> wrote:
>
> On Fri, Apr 18, 2025 at 1:51 AM Jim Meyering <jim <at> meyering.net> wrote:
> >
> > Surprised to find that coreutils-9.5 (fedora 41 stock) works fine:
> >
> >   $ { /bin/printf %4095s; /bin/printf %4096s; } > /dev/full
> >   /bin/printf: write error: No space left on device
> >   /bin/printf: write error: No space left on device
>
> Though OTOH (not sure why):
>
>     $ { /bin/printf %4096s; /bin/printf %4097s; } > /dev/full
>     /bin/printf: write error: No space left on device
>     /bin/printf: write error
>
> ----
>
> But I'm concerned that with this change because programs where:
>
>     1. errno is set by a failed (unchecked) write
>     2. errno is then set by some unrelated function
>     3. close_stdout() is arranged to run atexit
>     4. when close_stream() calls fclose() it does not fail
>
> will now erroneously report the error from the unrelated function
> when running close_stdout.
>
> Previously:
>
>     $ stdbuf -oL realpath -e . xxx >/dev/full
>     realpath: xxx: No such file or directory
>     realpath: write error
>
> After the patch:
>
>     $ stdbuf -oL src/realpath -e . xxx >/dev/full
>     realpath: xxx: No such file or directory
>     realpath: write error: No such file or directory

I think I've finally paged back in all of that from 20 years ago.
And I agree: there is no need for my most recent proposed change.
When fclose succeeds, yet there was a "prev_failure" but no fclose
failure, we cannot guarantee errno is relevant, so clearing it **is**
appropriate.
Now, as for what changed in F42 to make us go from printing the ENOSPC
expansion to not printing it, so far I haven't reproduced the failure.
Just built there and this works just as it does on F41:

$ src/grep --help > /dev/full

                                      :
src/grep: write error: No space left on device




This bug report was last modified 8 days ago.

Previous Next


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