[all-commits] [llvm/llvm-project] c6d95c: [libc++] Fix initialization-order-fiasco with iost...
Vitaly Buka via All-commits
all-commits at lists.llvm.org
Sat Feb 15 19:54:44 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c6d95c441a29a45782ff72d6cb82839b86fd0e4a
https://github.com/llvm/llvm-project/commit/c6d95c441a29a45782ff72d6cb82839b86fd0e4a
Author: Vitaly Buka <vitalybuka at google.com>
Date: 2025-02-15 (Sat, 15 Feb 2025)
Changed paths:
M libcxx/src/iostream.cpp
A libcxx/test/std/input.output/iostreams.base/ios.base/ios.types/ios_Init/ios_Init.global.pass.cpp
Log Message:
-----------
[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.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list