[0/6] Fix issues around flushing and file offsets for input files

Message ID ee49b35a-0bd1-233b-3fb7-c0b55d44fe8c@redhat.com (mailing list archive)
Headers
Series Fix issues around flushing and file offsets for input files |

Message

Joseph Myers Jan. 14, 2025, 2 a.m. UTC
  There are several open bugs relating to flushing of FILE* streams
(with fflush and other operations) and their offsets (both the file
position indicator in the FILE*, and the offset in the underlying open
file description), especially after ungetc but not limited to that
case.

Fix five such bugs.  Each has its own fix with associated test
specific to that bug; at the end of the patch series, add a test that
more systematically covers different combinations of cases for such
issues, with 25664 separate scenarios tested (which include examples
of all the five separate fixed bugs), all of which pass given the five
previous bug fixes.  (None of the patches do anything about the case
of the "old" FILE structure, where that uses separate function
implementations.)

It's likely most of the patches would work on their own or with only a
subset of the previous patches rather than having strict dependencies,
though they haven't been tested that way (but can be retested like
that if approved out of order).  In any case, these patches should
wait until after the 2.41 release to go in.  (Note in particular that
the fix for bug 12724 may be high risk; a previous attempt was made to
fix that bug and subsequently reverted because it caused problems.)