You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2006/08/28 21:28:24 UTC

[jira] Assigned: (STDCXX-280) SIGABRT in codecvt::out()

     [ http://issues.apache.org/jira/browse/STDCXX-280?page=all ]

Martin Sebor reassigned STDCXX-280:
-----------------------------------

    Assignee: Martin Sebor

> SIGABRT in codecvt::out()
> -------------------------
>
>                 Key: STDCXX-280
>                 URL: http://issues.apache.org/jira/browse/STDCXX-280
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization
>    Affects Versions: 4.1.2, 4.1.3
>         Environment: all
>            Reporter: Martin Sebor
>         Assigned To: Martin Sebor
>            Priority: Critical
>
> The program below aborts on Solaris 9:
> $ cat u.cpp && make u && LC_ALL=zh_CN.UTF-8@pinyin ./u
> #include <cassert>
> #include <cwchar>
> #include <iostream>
> int main ()
> {
>     typedef std::codecvt<wchar_t, char, std::mbstate_t> CodeCvt;
>     const std::locale loc ("");
>     const CodeCvt &cvt = std::use_facet<CodeCvt>(loc);
>     CodeCvt::state_type state = { };
>     const wchar_t* const from      = L"\n\377";
>     const wchar_t* const from_end  = from + 1;
>     const wchar_t*       from_next = 0;
>     char        to [40];
>     char* const to_limit = to + sizeof to;
>     char*       to_next  = 0;
>     CodeCvt::result res;
>     res = cvt.out (state, from, from_end, from_next, to, to_limit, to_next);
>     assert (cvt.ok == res);
>     assert (from_next == from_end);
>     assert (to_next == to + 1);
>     assert ('\n' == *to);
> }
> gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG    -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/../rwtest -I/build/sebor/dev/stdlib/../rwtest/include -I/build/sebor/dev/stdlib/tests/include  -pedantic -nostdinc++ -g  -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long  u.cpp
> u.cpp: In function 'int main()':
> u.cpp:11: warning: missing initializer for member '__mbstate_t::__filler'
> gcc u.o -o u -L/build/sebor/gcc-4.1.0-11s/rwtest -lrwtest11s  -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s  -lsupc++ -lm
> /build/sebor/dev/stdlib/src/wcodecvt.cpp:496: std::codecvt_base::result __rw::__rw_libc_do_out(__mbstate_t&, const wchar_t*, const wchar_t*, const wchar_t*&, char*, char*, char*&): Assertion 'from_next <= from_end' failed.
> Segmentation Fault (core dumped)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira