bug-gnulib
[Top][All Lists]
Advanced

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

test-fflush2 fails on debian unstable (probably lenny, too)


From: Jim Meyering
Subject: test-fflush2 fails on debian unstable (probably lenny, too)
Date: Wed, 18 Feb 2009 17:53:16 +0100

Currently, coreutils (latest snapshot) gets one failure
on debian unstable (and probably Lenny, too):

  FAIL: test-fflush2.sh.log (exit: 134)
  =====================================

  test-fflush2.c:112: assertion failed
  ./test-fflush2.sh: line 6:  9631 Aborted          ./test-fflush2${EXEEXT}
  2 < "$srcdir/test-fflush2.sh"
  make[6]: *** [test-suite.log] Error 1

debugging it, I see this:

    112             ASSERT (c == '!');
    (gdb) p (char)c
    $1 = 47 '/'

FYI, here's the end of test-fflush2.c:
If someone feels like investigating this that'd be nice.
Otherwise, I'll just exclude that test before the release,
since afaik, the programs in coreutils don't make enough
use of ungetc for this to matter.

================================
      case '2':
        /* Check fflush after a non-backup ungetc() call.  This is case 2a in
           terms of
           <http://lists.gnu.org/archive/html/bug-gnulib/2008-03/msg00131.html>,
           according to the Austin Group's resolution on 2009-01-08.  */
        /* Check that fflush after a non-backup ungetc() call discards the
           ungetc buffer.  This is mandated by POSIX
           <http://www.opengroup.org/susv3/functions/ungetc.html>:
             "The value of the file-position indicator for the stream after
              reading or discarding all pushed-back bytes shall be the same
              as it was before the bytes were pushed back."
           <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>
             "[After fflush(),] the file offset of the underlying open file
              description shall be set to the file position of the stream, and
              any characters pushed back onto the stream by ungetc() or
              ungetwc() that have not subsequently been read from the stream
              shall be discarded."  */

        c = fgetc (stdin);
        ASSERT (c == '#');

        c = fgetc (stdin);
        ASSERT (c == '!');

        /* Here the file-position indicator must be 2.  */

        c = ungetc ('@', stdin);
        ASSERT (c == '@');

        fflush (stdin);

        /* Here the file-position indicator must be 1.  */

        c = fgetc (stdin);
        ASSERT (c == '!');

        c = fgetc (stdin);
        ASSERT (c == '/');

        return 0;
      }

  return 1;
}




reply via email to

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