Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2006-03-06 10:26:45

"Vladimir Prus" <ghost_at_[hidden]> wrote in message
> Hi,
> an application of mine just suddenly crashed before entering 'main', with
> the
> following stacktrace:
> #5 0xb7eb7106 in __cxa_throw () from /usr/lib/
> #6 0xb7e6ccb0 in std::__throw_runtime_error ()
> from /usr/lib/
> #7 0xb7eb5c8e in std::locale::facet::_S_create_c_locale ()
> from /usr/lib/
> #8 0xb7e96554 in std::locale::_Impl::_Impl ()
> from /usr/lib/
> #9 0xb7e768e9 in std::locale::locale () from /usr/lib/
> #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".

Ah! This may expain so other error reports of aborts before main() has

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

OK, this has been changed in CVS. Please try it with the same LC_MESSAGES
problem, and let me know if the exception occurs at a more appropriate time.

I'm also wondering if the path.cpp code should catch the exception and call
boost::throw_exception() with a filesystem_error. What do you think about
doing that? Would it have made diagnosing the problem easier for you?

Thanks very much for the detailed report and suggested fix. That is ever so
much more helpful than a bald "it crashed" report.


Boost list run by bdawes at, gregod at, cpdaniel at, john at