llvm-project
c6d95c44 - [libc++] Fix initialization-order-fiasco with iostream.cpp constructors (#126995)

Commit
207 days ago
[libc++] Fix initialization-order-fiasco with iostream.cpp constructors (#126995) Asan reports it after #124103. It's know case of false positive for Asan. https://github.com/google/sanitizers/wiki/AddressSanitizerInitializationOrderFiasco#false-positives It's can be avoided with `constexpr` constructors. In general order global constructors in different modules is undefined. If global constructor uses external global, they can be not constructed yet. However, implementation may contain workaround for that, or the state of non-constructed global can be still valid. Asan will still falsely report such cases, as it has no machinery to detect correctness of such cases. We need to fix/workaround the issue in libc++, as it will affect many libc++ with Asan users.
Author
Parents
Loading