Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 9662 invoked from network); 25 May 2007 23:10:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 May 2007 23:10:40 -0000 Received: (qmail 28788 invoked by uid 500); 25 May 2007 23:10:42 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 28730 invoked by uid 500); 25 May 2007 23:10:42 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 28646 invoked by uid 99); 25 May 2007 23:10:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 May 2007 16:10:42 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 May 2007 16:10:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BA7A1714069 for ; Fri, 25 May 2007 16:10:16 -0700 (PDT) Message-ID: <10667927.1180134616761.JavaMail.jira@brutus> Date: Fri, 25 May 2007 16:10:16 -0700 (PDT) From: "Martin Sebor (JIRA)" To: stdcxx-dev@incubator.apache.org Subject: [jira] Closed: (STDCXX-428) [Linux] huge empty file created after an ungetwc() followed by fwide() In-Reply-To: <2897905.1180050856153.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/STDCXX-428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Sebor closed STDCXX-428. ------------------------------- Resolution: Invalid -------- Original Message -------- Subject: [Bug 241309] huge empty file created after an ungetwc() followed by fwide() Date: Fri, 25 May 2007 02:37:03 -0400 From: bugzilla@redhat.com To: sebor@roguewave.com Please do not reply directly to this email. All additional comments should be made in the comments box of this bug report. Summary: huge empty file created after an ungetwc() followed by fwide() https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=241309 jakub@redhat.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |drepper@redhat.com ------- Additional Comments From jakub@redhat.com 2007-05-25 02:37 EST ------- This testcase violates ISO C99, 7.19.2(5): "wide character input/output functions shall not be applied to a byte-oriented stream." puts is a byte output function, therefore the stream after puts is byte-oriented. ungetwc is wide input/output function and thus must not be used until you reorient the stream. > [Linux] huge empty file created after an ungetwc() followed by fwide() > ---------------------------------------------------------------------- > > Key: STDCXX-428 > URL: https://issues.apache.org/jira/browse/STDCXX-428 > Project: C++ Standard Library > Issue Type: Bug > Reporter: Martin Sebor > Attachments: strace.out > > > From https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=241309: > -------- Original Message -------- > Subject: [Bug 241309] New: huge empty file created after an ungetwc() followed by fwide() > Date: Thu, 24 May 2007 19:50:56 -0400 > From: bugzilla@redhat.com > To: sebor@roguewave.com > Please do not reply directly to this email. All additional > comments should be made in the comments box of this bug report. > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=241309 > Summary: huge empty file created after an ungetwc() followed by fwide() > Product: Red Hat Enterprise Linux > Version: 4.4 > Platform: All > OS/Version: Linux > Status: NEW > Severity: medium > Priority: medium > Component: glibc > AssignedTo: jakub@redhat.com > ReportedBy: sebor@roguewave.com > QAContact: bbrock@redhat.com > We're seeing the following unusual behavior of the program below on Red Hat > Advanced Server 4, Update 4: > $ cat t.c && gcc t.c && rm -f foo.out && ./a.out > foo.out && ls -l foo.out && > du -k foo.out > #include > #include > int main () > { > puts (""); > ungetwc ('A', stdout); > fwide (stdout, 0); > return 0; > } > -rw-r--r-- 1 sebor devel 182888783729 May 24 16:44 foo.out > 16 foo.out > The output of strace on the program is in the attached file. > Here's info on libc: > $ ldd a.out && /lib64/tls/libc.so.6 > libc.so.6 => /lib64/tls/libc.so.6 (0x000000381b500000) > /lib64/ld-linux-x86-64.so.2 (0x000000381b100000) > GNU C Library stable release version 2.3.4, by Roland McGrath et al. > Copyright (C) 2005 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. > There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A > PARTICULAR PURPOSE. > Compiled by GNU CC version 3.4.6 20060404 (Red Hat 3.4.6-2). > Compiled on a Linux 2.4.20 system on 2006-07-04. > Available extensions: > GNU libio by Per Bothner > crypt add-on version 2.1 by Michael Glad and others > Native POSIX Threads Library by Ulrich Drepper et al > RT using linux kernel aio > The C stubs add-on version 2.1.2. > GNU Libidn by Simon Josefsson > BIND-8.2.3-T5B > NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk > Thread-local storage support included. > For bug reporting instructions, please see: > . > ------- Additional Comments From sebor@roguewave.com 2007-05-24 19:50 EST ------- > Created an attachment (id=155405) > --> (https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=155405&action=view) > Output of strace ./a.out >/dev/null 2>/dev/pts/1 > -- > Configure bugmail: https://bugzilla.redhat.com/bugzilla/userprefs.cgi?tab=email > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.