From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24567 invoked by alias); 21 Nov 2001 15:56:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 24541 invoked by uid 71); 21 Nov 2001 15:56:00 -0000 Date: Fri, 16 Nov 2001 23:46:00 -0000 Message-ID: <20011121155600.24540.qmail@sourceware.cygnus.com> To: pme@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Brad Garcia Subject: Re: libstdc++/2913 Reply-To: Brad Garcia X-SW-Source: 2001-11/txt/msg00434.txt.bz2 List-Id: The following reply was made to PR libstdc++/2913; it has been noted by GNATS. From: Brad Garcia To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, donut@azstarnet.com, pme@gcc.gnu.org, gcc-bugs@gcc.gnu.org Cc: Subject: Re: libstdc++/2913 Date: Wed, 21 Nov 2001 11:15:45 -0500 (EST) http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2913&database=gcc We've done some testing and determined that the implementation of basic_filebuf::_M_really_overflow is ignoring the return value of _M_file->sync(). We are seeing sync() return EOF as expected during the out-of-space condition, but since this isn't being checked and propagated, the badbit is not getting set in basic_ios. So this is definitely a bug in libstdc++, not in the operating system. And it's a pretty severe bug. Basically, we will never catch errors that occur when we attempt to close a stream (where the close causes a final flush to occur before actually closing the file). pme said: The current default configuration passes I/O to the stdio fwrite(3) function; the only thing the C++ library knows is what fwrite(3) returns, namely, the bytes successfully written. If something goes wrong (out of space), a short count is returned. The C++ library tests for this condition (in xsputn()) and set the failbit accordingly. If the underlying filesystem doesn't do anything that would cause fwrite(3) to return an error, then the C++ library has nothing to go on. The behavior of the OS kernel and its filesystem drivers also come into play. Brad Garcia