From stdcxx-dev-return-2641-apmail-incubator-stdcxx-dev-archive=incubator.apache.org@incubator.apache.org Mon Feb 19 21:55:33 2007 Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 25211 invoked from network); 19 Feb 2007 21:55:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Feb 2007 21:55:33 -0000 Received: (qmail 60593 invoked by uid 500); 19 Feb 2007 21:55:41 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 60533 invoked by uid 500); 19 Feb 2007 21:55:41 -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 60522 invoked by uid 99); 19 Feb 2007 21:55:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Feb 2007 13:55:41 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [216.148.227.153] (HELO rwcrmhc13.comcast.net) (216.148.227.153) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Feb 2007 13:55:29 -0800 Received: from [127.0.0.1] (c-67-176-53-28.hsd1.co.comcast.net[67.176.53.28]) by comcast.net (rwcrmhc13) with ESMTP id <20070219215508m1300kgf6fe>; Mon, 19 Feb 2007 21:55:08 +0000 Message-ID: <45DA1C9E.3050408@roguewave.com> Date: Mon, 19 Feb 2007 14:54:38 -0700 From: Martin Sebor User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.2pre) Gecko/20070111 SeaMonkey/1.1 MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: Re: [jira] Commented: (STDCXX-333) std::wfilebuf extracts more than 1 character from a 1 byte file References: <45da0a07.4050902@roguewave.com> <16307314.1171916285551.javamail.jira@brutus> <240AA750574.00000762mbrown@inbox.com> <45DA17E6.3000409@roguewave.com> In-Reply-To: <45DA17E6.3000409@roguewave.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Martin Sebor wrote: > Mark Brown wrote: >> I decided to look into this as an exercise in stdcxx debugging and >> managed to figure out how to get around the error and generate the >> en_US.UTF-8 locale. > > Great! Thanks for the detective work! > >> The change I made to make it work is in the >> attached patch file. Let me know if this is the correct format >> for patches or if you prefer something else. I should have mentioned: when posting patches to the list please start the subject line with the string "[PATCH]" to make it stand out. It's also good to give the email a descriptive title, or change it to one when following up on an unrelated topic (as in this case :) Read the section below for more on how to submit patches: http://incubator.apache.org/stdcxx/bugs.html#patches Martin > > I don't see the patch. Did you forget to attach it? (Sometimes the > attachments end up getting stripped by ezmlm even though they > shouldn't). If it's small, you might want to paste it directly into > your mail. Otherwise you might need to post it somewhere (e.g., on > your web page or in the issue itself). > >> >> Incidentally, the original test program for stdcxx-333 runs fine >> on Cygwin with the en_US.UTF-8 locale so the error must be unique >> to Linux. > > Hmm. Very odd. > > Martin > >> >> -- Mark >> >> >>> -----Original Message----- >>> From: mbrown@inbox.com >>> Sent: Mon, 19 Feb 2007 12:51:24 -0800 >>> To: stdcxx-dev@incubator.apache.org, stdcxx-dev@incubator.apache.org >>> Subject: Re: [jira] Commented: (STDCXX-333) std::wfilebuf extracts more >>> than 1 character from a 1 byte file >>> >>>> -----Original Message----- >>>> From: sebor@roguewave.com >>>> Sent: Mon, 19 Feb 2007 13:35:19 -0700 >>>> To: stdcxx-dev@incubator.apache.org >>>> Subject: Re: [jira] Commented: (STDCXX-333) std::wfilebuf extracts more >>>> than 1 character from a 1 byte file >>>> >>>> Mark Brown (JIRA) wrote: >>>>> [ >>> https://issues.apache.org/jira/browse/STDCXX-333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474266 >>> >>>>> ] >>>>> >>>>> Mark Brown commented on STDCXX-333: >>>>> ----------------------------------- >>>>> >>>>> I tried to see if I could reproduce this problem on Cygwin. My version >>>>> of Cygwin doesn't have any locales so I tried to generate the >>>>> en_US.UTF-8 locale using the stdcxx localedef program. I got this >>>>> error: >>>>> >>>>> nls$ ../bin/localedef -c -f /home/mbrown/stdcxx/etc/nls/charmaps/UTF-8 >>>>> -i /home/mbrown/stdcxx/etc/nls/src/en_US en_US.UTF-8 >>>>> call to system LC_ALL=C /usr/bin/locale -a >/tmp/tdf4.0 >>>>> 2>/dev/null: No >>>>> such file or directory >>>>> Hangup >>>> This looks like an unrelated problem. Could you open a new issue for >>>> it? >>> Sure. Here it is: https://issues.apache.org/jira/browse/STDCXX-340. >>> >>> Mark >>> >>>> Thanks >>>> Martin >>>> >>>>> >>>>>> std::wfilebuf extracts more than 1 character from a 1 byte file >>>>>> --------------------------------------------------------------- >>>>>> >>>>>> Key: STDCXX-333 >>>>>> URL: https://issues.apache.org/jira/browse/STDCXX-333 >>>>>> Project: C++ Standard Library >>>>>> Issue Type: Bug >>>>>> Components: 27. Input/Output >>>>>> Affects Versions: 4.1.3 >>>>>> Environment: gcc 3.2.3 on Linux >>>>>> Reporter: Mark Brown >>>>>> >>>>>> I get an an abort when I run the following program on Linux. >>>>>> #include >>>>>> #include >>>>>> #include >>>>>> int main () >>>>>> { >>>>>> { >>>>>> std::filebuf fb; >>>>>> fb.open ("file", std::ios::out); >>>>>> fb.sputc ('a'); >>>>>> } >>>>>> std::wfilebuf fb; >>>>>> fb.pubimbue (std::locale ("en_US.UTF-8")); >>>>>> fb.open ("file", std::ios::in); >>>>>> const int c[] = { fb.sbumpc (), fb.sgetc () }; >>>>>> std::cout << c [0] << ' ' << c [1] << std::endl; >>>>>> assert (L'a' == c [0]); >>>>>> assert (std::wfilebuf::traits_type::eof () == c [1]); >>>>>> } >>>>>> test: test.cpp:21: int main(): Assertion >>>>>> `std::wfilebuf::traits_type::eof () == c [1]' failed. >>>>>> Aborted > > > >