Boost logo

Boost :

Subject: Re: [boost] [Locale] Static locale initialisation
From: Artyom (artyomtnk_at_[hidden])
Date: 2010-04-05 03:27:05

> I'm encountering a crash with > Boost.Locale as the process terminates > > I initialise the global Boost.Locale in the contructor of a > class with a > single static instance (the ATL module to be exact) as I > don't have access > to the code of my main method (it comes from the Boost.Test > runner).   A > static object seems to be the only logical place to put > this code: > > <snip> I've tried to reproduce the bug but I couldn't: at least with MSVC9 with Release and Debug builds and under Linux. (I do not have MSVC8 you are using). Can you provide a simple sample of the code that reproduces the issue so I can debug it? Also what setup are you using: - Debug, Release or RelWithDebInfo builds - How do you use Boost.Locale - static version or dynamic (dll)? if you use static version are you sure you link with correct ICU library -- (debug versions of ICU library end with "d" suffix) - What version of Boost.Locale you use? Taken from SVN, or - What is your system locale? - Does program crashes when dictionaries are not loaded? (i.e. comment out: gen.add_messages_domain("swish"); ) - What ICU version do you have? > > If I move the initialisation code to run just before each > point I need to > use translate() then it works fine.  So maybe this has > something to do with > the way static data is destroyed.  This is on Windows > - not sure about > other platforms. > > Any ideas? Can you try please following: add global destructor that would reset the global locale to standard one: ~CModule() { std::locale::global(std::locale::classic()); } > > Many thanks. > > Alex Lamaison > > P.S. I realise Boost.Locale isn't in Boost yet but previous > discussions > have been here so it seems a reasonable place to ask. Yes this is the place, I would request the formal review soon, so I do need inputs from users before I do it. Thanks, Artyom

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