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


View this message in rfc822 format

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: bug#77800: grep-3.12: write-error-msg test failure on fedora rawhide (f43)
Date: Thu, 17 Apr 2025 22:51:12 -0700
On Thu, Apr 17, 2025 at 10:35 PM Grisha Levit <grishalevit <at> gmail.com> wrote:
> On Fri, Apr 18, 2025, 01:18 Jim Meyering <jim <at> meyering.net> wrote:
> >
> > On Tue, Apr 15, 2025 at 9:17 PM Jim Meyering <jim <at> meyering.net> wrote:
> > ...
> > > We're going to have to revise that code.
> > > The difference I see is that before rawhide, that fclose would fail.
> > > It's perfectly fine for fclose to succeed in this case, as now happens
> > > on rawhide (because with 4k BUFSIZ, the fclose wrote nothing -- the
> > > preceding 4096-byte write is what failed).
> > >
> > > Here's a better patch: (technically, we could factor it somewhat, but
> > > readability would suffer disproportionately)
> >
> > I didn't take the time to find a precise commit, but this bug predates
> > the move from closeout.c to gnulib's close-stdout.c in 2006. As I
> > write this, I'm installing Fedora 42.
> > I'll probably push the attached to gnulib tomorrow:
>
> > Exposed via Fedora 42's new glibc vs grep's --help being precisely
> > 4096 bytes.
>
> AFAICT this is not related to F42 or new glibc, it's just longer help
> text in grep-3.12 + Fedora patch making it even longer.  But you should
> see the same behavior on existing systems with e.g.:
>
>     $ { env printf %4095s; env printf %4096s; } > /dev/full
>     printf: write error: Broken pipe
>     printf: write error

Nice. Thanks. Will adjust the commit log and ChangeLog.
I confirmed that coreutils-9.7's printf with this fix is no longer
susceptible to that failure.

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




This bug report was last modified 7 days ago.

Previous Next


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