stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-211) SIGABRT in locale combining ctor after use_facet
Date Fri, 02 Mar 2007 00:04:50 GMT

    [ https://issues.apache.org/jira/browse/STDCXX-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12477141
] 

Martin Sebor commented on STDCXX-211:
-------------------------------------

Interesting. It still aborts on HP-UX with the two locales mentioned in the report but works
with some others:

./t es_ES.utf8 en_US.iso88591
es_ES.utf8 es_ES.utf8 es_ES.utf8 es_ES.utf8 es_ES.utf8 es_ES.utf8, es_ES.utf8 es_ES.utf8 es_ES.utf8
es_ES.utf8 en_US.iso88591 es_ES.utf8
es_ES.utf8 es_ES.utf8 es_ES.utf8 es_ES.utf8 es_ES.utf8 es_ES.utf8, es_ES.utf8 es_ES.utf8 es_ES.utf8
es_ES.utf8 en_US.iso88591 es_ES.utf8
es_ES.utf8 es_ES.utf8 es_ES.utf8 es_ES.utf8 es_ES.utf8 es_ES.utf8, es_ES.utf8 es_ES.utf8 es_ES.utf8
es_ES.utf8 en_US.iso88591 es_ES.utf8
es_ES.utf8 es_ES.utf8 es_ES.utf8 es_ES.utf8 es_ES.utf8 es_ES.utf8, es_ES.utf8 es_ES.utf8 es_ES.utf8
es_ES.utf8 en_US.iso88591 es_ES.utf8

Modifying the test case to catch exceptions shows that the da_DK.iso8859 locale isn't valid
even though it's installed (i.e., it shows up in the output of locale -a):

$ cat t.cpp && gmake t && ./t da_DK.iso8859 en_US.roman8
#include <cstdio>
#include <exception>
#include <locale>

template <class charT>
void foo (const char *name1, const char *name2)
{
    try {
        const std::locale l0 (name1);
        const std::locale l1 (l0, name2, std::locale::time);

        std::printf ("%s, %s\n", l0.name ().c_str (), l1.name ().c_str ());

        std::use_facet<std::time_get<charT> >(l1);

        std::printf ("%s, %s\n", l0.name ().c_str (), l1.name ().c_str ());
    }
    catch (const std::exception &e) {
        std::printf ("caught exception (\"%s\")\n", e.what ());
    }
}


int main (int argc, char *argv[])
{
    foo<char>(argc > 1 ? argv [1] : "", argc > 2 ? argv [2] : "");
    foo<wchar_t>(argc > 1 ? argv [1] : "", argc > 2 ? argv [2] : "");
}
aCC -c -I/nfs/devco/sebor/dev/stdlib/include/ansi -I/usr/include  -D_RWSTDDEBUG   -mt -D_RWSTD_USE_CONFIG
-I/nfs/devco/sebor/dev/stdlib/include -I/build/sebor/aCC-3.70-15S/include -I/nfs/devco/sebor/dev/stdlib/examples/include
 -Aa +nostl  -g +d  +DD64 +w +W392 +W655 +W684 +W818 +W819 +W849   t.cpp
aCC t.o -o t -Aa +nostl -Wl,+s -Wl,+vnocompatwarnings   -mt +DD64 -L/build/sebor/aCC-3.70-15S/lib
-lstd15S   -lm 
caught exception ("/amd/devco/sebor/dev/stdlib/src/locale_combine.cpp:639: std::locale::locale(const
char *): bad locale name: "da_DK.iso8859"")
caught exception ("/amd/devco/sebor/dev/stdlib/src/locale_combine.cpp:639: std::locale::locale(const
char *): bad locale name: "da_DK.iso8859"")


> SIGABRT in locale combining ctor after use_facet
> ------------------------------------------------
>
>                 Key: STDCXX-211
>                 URL: https://issues.apache.org/jira/browse/STDCXX-211
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 22. Localization
>    Affects Versions: 4.1.3, 4.1.2
>         Environment: all
>            Reporter: Martin Sebor
>
> Moved from the Rogue Wave bug tracking database:
> ****Created By: sebor @ Jun 19, 2004 03:00:35 PM****
> The program below aborts on most (if not all) platforms. Output shown is on HP-UX 11.00
with aCC 3.52.
> $ cat t.cpp
> #include <cstdio>
> #include <locale>
> template <class charT>
> void foo (const char *name1, const char *name2)
> {
>     {
>         const std::locale l0 (name1);
>         const std::locale l1 (l0, name2, std::locale::time);
>         std::printf ("%s, %s\n", l0.name ().c_str (), l1.name ().c_str ());
>         std::use_facet<std::time_get<charT> >(l1);
>         std::printf ("%s, %s\n", l0.name ().c_str (), l1.name ().c_str ());
>     }
>     return;
> }
> int main (int argc, char *argv[])
> {
>     foo<char>(argc > 1 ? argv [1] : "", argc > 2 ? argv [2] : "");
>     foo<wchar_t>(argc > 1 ? argv [1] : "", argc > 2 ? argv [2] : "");
> }
> $ aCC -c -I/build/sebor/dev/stdlib/include/ansi -I/usr/include  -D_RWSTDDEBUG  -D_RWSTD_NO_EXTERN_TEMPLATE
 -D_RWSTD_USE_CONFIG   -I/build/sebor/aCC-3.52-11s/include -I/build/sebor/dev/stdlib/include
-I/build/sebor/dev/stdlib/../rwtest -I/build/sebor/dev/stdlib/../rwtest/include -I/build/sebor/dev/stdlib/tests/include
 -Aa +nostl  -g +d    +w +W392 +W655 +W684 +W818 +W819 +W849  t.cpp && aCC t.o -o
t -L/build/sebor/aCC-3.52-11s/rwtest -lrwtest11s -L/build/sebor/aCC-3.52-11s/lib -lstd11s
-lm -Aa +nostl -Wl,+s -Wl,+vnocompatwarnings -L/build/sebor/aCC-3.52-11s/lib && ./t
> C C C C C C, C C C C C C
> *, *
> /build/sebor/dev/stdlib/src/locale_combine.cpp:571: static __rw::__rw_locale *__rw::__rw_locale::_C_make_body(__rw::__rw_locale
*,__rw::__rw_locale *,const char *,int,const __rw::__rw_facet *): Assertion '!plocale || plocale->_C_is_managed
(_STD::locale::none)' failed.
> ( 0)  0x00010440   __rw_assert_fail__4__rwFPCcT1iT1 + 0x7c  [././t]
> ( 1)  0x0001ae58   _C_make_body__Q2_4__rw11__rw_localeSFPQ2_4__rw11__rw_localeT1PCciPCQ2_4__rw10__r
+ 0x464  [././t]
> ( 2)  0x0001b3cc   __ct__Q2_3std6localeFPCc_2 + 0x5c  [././t]
> ( 3)  0x0000bf94   foo__XTw_FPCcT1 + 0x20  [././t]
> ( 4)  0x0000be2c   main + 0x94  [././t]
> ( 5)  0xc013e8fc   _start + 0xc8  [/usr/lib/libc.2]
> ( 6)  0x0000acb0   $START$ + 0x178  [././t]
> ABORT instruction (core dumped)
> $ ./t da_DK.iso8859 en_US.roman8
> ABORT instruction (core dumped)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message