https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98108
--- Comment #2 from i.hamsa at gmail dot com --- The standard streams are not user defined objects. They need to be initialized before any user code touches them, before `main`, before everything, no matter what. This is exactly the purpose of the "nifty counter". It works perfectly well in single-threaded environments. The problem is that libstdc++ implementation of it purports to be thread-safe. It isn't.