Details
-
Bug
-
Resolution: Won't Fix
-
Major - P3
-
None
-
None
-
None
-
Fully Compatible
-
ALL
Description
https://github.com/mongodb/mongo/blob/master/src/mongo/db/sorter/sorter.cpp#L768
In C++03, the initialization of function statics is not thread-safe (it is in C++11). While some compilers, notably GCC, actually implement thread-safe statics in C++03 mode by default unless asked not to, other compilers do not.
On such platforms, it could be possible for the atomic to be initialized twice, probably leading to inconsistent results.