initializer for function local static variable called enclosing function

Hello,

Today I encountered a problem when viewing some code.

When executing the complied binary it aborted and give the error message.
“initializer for function local static variable called enclosing function”

The code is like this,

static bool isDumpEnabled = getenv(“env_dump_something”) ! = 0

When executing this code, this error occurred once.

But I don’t know why.
I had a look at the code in this page,
http://www.opensource.apple.com/source/libcppabi/libcppabi-26/src/cxa_guard.cxx

It seems the error is because that initializing static variable twice in one thread.

Is that possible, or it is a optimization error for llvm?

Any tips are welcome!