From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18247 invoked by alias); 30 Mar 2008 03:41:38 -0000 Received: (qmail 18114 invoked by uid 48); 30 Mar 2008 03:40:56 -0000 Date: Sun, 30 Mar 2008 03:41:00 -0000 Subject: [Bug libstdc++/35763] New: std::cout loses whole blocks of output if interrupted by signal without SA_RESTART X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "zlynx at acm dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg02420.txt.bz2 I noticed this when running a program that uses a periodic timer signal. The sigaction did not set SA_RESTART. During program runs, huge chunks of console output would disappear. I sort of tracked this down to the code in libstdc++ that uses fwrite to do the output of cout and cerr. That is a bit weird, I expected it to be using the basic_file operations on fd 0 instead. In summary, it appears to call fwrite and never check the error return, then it increments the streambuf pointers and loses that whole output block. -- Summary: std::cout loses whole blocks of output if interrupted by signal without SA_RESTART Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: zlynx at acm dot org GCC host triplet: x86_64-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35763