does g++ delay initializing static local variables?

Brendan Miller catphive@catphive.net
Fri May 13 22:34:00 GMT 2011


On Wed, May 11, 2011 at 2:35 AM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 11 May 2011 01:52, Brendan Miller wrote:
>>
>> In some older versions of G++ there seems to be a bug in the lazy
>> initialization code that was causing an exception to be thrown in some
>> circumstances.
>
> Can you reliably reproduce those circumstances or is it something
> you've only seen in occasional stack traces?
>

It's a multi-threading problem, so it's inherently not deterministic.
However, I asked and apparently we've been seeing that code throw an
exception on a regular basis.

This is in the context of a larger c++ application... I've been trying
to think of what reason could cause the lazy initialization code to
throw an exception... The only case where it *should* throw is if
there's recursion on initialization, but there is none in our code.



More information about the Gcc-help mailing list