Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-03-06 07:03:31


Hi,
an application of mine just suddenly crashed before entering 'main', with the
following stacktrace:

    #5 0xb7eb7106 in __cxa_throw () from /usr/lib/libstdc++.so.5
    #6 0xb7e6ccb0 in std::__throw_runtime_error ()
        from /usr/lib/libstdc++.so.5
    #7 0xb7eb5c8e in std::locale::facet::_S_create_c_locale ()
        from /usr/lib/libstdc++.so.5
    #8 0xb7e96554 in std::locale::_Impl::_Impl ()
         from /usr/lib/libstdc++.so.5
    #9 0xb7e768e9 in std::locale::locale () from /usr/lib/libstdc++.so.5
    #10 0xb78f6922 in __static_initialization_and_destruction_0
       (__initialize_p=1, __priority=65535)
        at /space/NM/boost/libs/filesystem/src/path.cpp:29

And the line in question contains just:

29 std::locale loc("");

This is CVS as of today. The problem was that I incorrectly set the
LC_MESSAGES environment variable. However, I think that exception from static
object is not so good idea. I can't catch it, so the error reporting just
reads "Aborted".

Maybe, this can be converted into a function with static variable, so that the
static variable is only initialized on the first call?

TIA,
Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk