Boost logo

Boost :

Subject: Re: [boost] [Locale] Static locale initialisation
From: Alexander Lamaison (awl03_at_[hidden])
Date: 2010-04-05 09:11:23


On Mon, 5 Apr 2010 00:27:05 -0700 (PDT), Artyom wrote:

>> 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?

I'll try and whip something up tonight.

> Also what setup are you using:
>
> - Debug, Release or RelWithDebInfo builds

Debug

> - 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)

I'm statically linking with my compiled Boost.Locale but I'm using the ICU
DLLs from the ICU site - I'm not compiling my own. These don't have the d
suffix as debug builds aren't redistributable. I believe they are also
compiled with MSVC9 where I'm using MSVC8. Would this cause a problem. I
expected that, if it did, it would fail completely not partially work like
this.

> - What version of Boost.Locale you use? Taken from SVN, boost_locale.zip
> or boost_locale-svn_r1112.zip?

svn_r1112.zip

> - What is your system locale?

Testing with en_GB and nl.

> - Does program crashes when dictionaries are not loaded? (i.e. comment
> out: gen.add_messages_domain("swish"); )
> - What ICU version do you have?

4.2.1

> Can you try please following: add global destructor that would reset
> the global locale to standard one:
>
> ~CModule()
> {
> std::locale::global(std::locale::classic());
> }

This didn't make a difference.

Thanks.

Alex Lamaison


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