Haunting a Windows "Subsurface not start but becoming zombie" bug
thiago at macieira.org
Mon Apr 10 08:51:11 PDT 2017
Em domingo, 9 de abril de 2017, às 16:47:25 PDT, Lubomir I. Ivanov escreveu:
> g++ test.cpp -Wall -std=c++11 -O1 -S -o test-meyer.S
> so, it's guarded with ___cxa_guard_acquire() and it appears that the
> c++11 flag doesn't matter much.
That's because GCC has used thread-safe initialisation of function statics for
a long time. I know it was specified in the IA-64 C++ ABI, dating from 1999,
but it's possible GCC supported it for longer (3.3 or earlier).
But it wasn't part of the C++ language specification. It only said that "if the
initialisation is reentered, behaviour is undefined". So other compilers did
not need to implement it.
C++11 did add a requirement that such initialisation must not deadlock. This
is known to trip several implementations. Apple operating systems are known to
fail that second bit too.
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
More information about the subsurface