bug-m4
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

stdout full [was: HEAD: inclusion order wrong for input.c]


From: Eric Blake
Subject: stdout full [was: HEAD: inclusion order wrong for input.c]
Date: Wed, 11 Apr 2007 07:24:24 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 4/10/2007 12:55 PM:

Hi Ralf,

> 
>> Here's another iteration (and it should go faster, by showing me ALL of
>> the stderr, rather than giving up at the first mismatch - fun with cheap
>> m4 tricks).
> 
> Here's the output with that patch applied instead:

Thanks for the output.  I'll have a patch soon.  But in the meantime, I
had an interesting observation:

> ../../m4/tests/others.at:613: m4 -b -d --help >/dev/full < /dev/null
> stderr:
> m4: write error

> ../../m4/tests/others.at:619: m4 -b -d --version >/dev/full < /dev/null
> stderr:
> m4: write error: No space left on device

Both --help and --version share very similar code paths, so it was
surprising to see their output differ.  But I think I finally figured out
the difference in the output:

tests/m4 --help | wc
     87     526    4120

In other words, now that --help output is larger than 4k, it is big enough
that your stdio flushed the first page and set the stream error bit in the
process; then the gnulib closeout module sees that the stream error bit
was already set but can't get at the errno that set it.  Whereas the
- --version output is shorter, so the stdio has not flushed anything to
disk, the error bit is not set, and the closeout module is able to get
errno from fflush as the first failing disk operation.  Maybe a difference
between glibc and newlib is that glibc treats fflush as a nop once the
stream error bit is set, but newlib still tries subsequent disk operations
which regenerate errno?  But I guess it doesn't matter; the problem is
still a bug in the testsuite for being too strict on expected output.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGHOGI84KuGfSFAYARAnOwAKCh23HRl4zjR4l9IBkEe65sBFqg7QCfZV5D
eEaez1aM5jQ0sXe5Yc3QWyA=
=9nIh
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]