stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: [jira] Commented: (STDCXX-333) std::wfilebuf extracts more than 1 character from a 1 byte file
Date Mon, 19 Feb 2007 21:34:30 GMT
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 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 <cassert>
>>>>> #include <fstream>
>>>>> #include <iostream>
>>>>> 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



Mime
View raw message