This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/28059] codecvt locale facet is broken (reproducible crash)
- From: "rleigh at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jun 2006 16:59:08 -0000
- Subject: [Bug libstdc++/28059] codecvt locale facet is broken (reproducible crash)
- References: <bug-28059-7852@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #17 from rleigh at debian dot org 2006-06-16 16:59 -------
Created an attachment (id=11682)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11682&action=view)
Use mbsnrtowcs directly.
This testcase is similar to the original, with the exception that it uses
mbsnrtowcs in place of the codecvt locale facet. It also initialises the
locale with setlocale() for LC_CTYPE.
It shows some interesting results, in fact the exact opposite of the original
testcase:
GCC ver powerpc i386
3.3 fail fail
3.4 OK OK
4.0 OK fail
4.1 OK fail
4.2 OK fail
With this test, the expected output is this:
$ ./wide2
1
fffäß»
fffäß»
The output for the failed tests:
GCC 3.3:
powerpc (GCC 3.3 was bad at wide streams; the output is "lost"):
$ ./wide2
1
fffäß»
i386:
$ ./wide2
wide2: ../iconv/loop.c:425: utf8_internal_loop_single: Assertion `inptr -
bytebuf > (state->__count & 7)' failed.
Aborted
GCC 4.0/i386:
$ ./wide2
wide2: ../iconv/loop.c:425: utf8_internal_loop_single: Assertion `inptr -
bytebuf > (state->__count & 7)' failed.
Aborted
GCC 4.1/i386:
./wide2
wide2: ../iconv/loop.c:425: utf8_internal_loop_single: Assertion `inptr -
bytebuf > (state->__count & 7)' failed.
Aborted
GCC 4.2/i386:
$ ./wide2
wide2: ../iconv/loop.c:425: utf8_internal_loop_single: Assertion `inptr -
bytebuf > (state->__count & 7)' failed.
Aborted
Please do allow for the fact that one (or both) of these testcases might be
buggy; I've never used these interfaces before. However... the behaviour is
still highly variable between the two platforms.
Regards,
Roger
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28059