Issue |
142066
|
Summary |
[libc++] v2 ABI silently introduces new non-conforming behaviour for smart pointer destruction
|
Labels |
libc++
|
Assignees |
|
Reporter |
jrtc27
|
_LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI and _LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI are enabled for libc++'s v2 ABI and above (and unstable ABI). As documented in libcxx/docs/DesignDocs/UniquePtrTrivialAbi.rst (but that does not mention it's enabled by default for v2 and above), this is a non-conforming implementation that can lead to destructors being called in an order not permitted by the standard. Whilst I understand the appeal of the performance gain these options give, libc++ should not deliberately and silently be regressing standards conformance in the name of performance as part of opting into its v2 ABI. I would consider this a blocker for FreeBSD ever adopting that new ABI; we've had enough pain from adopting libc++ before it had a conforming std::pair implementation and having to maintain and keep providing that non-conformance for ABI compatibility despite it breaking real-world software. Maybe this one is harmless in practice, but any non-conformance has the potential to cause problems, and this would be a strict regression over v1.
These options should be split out from the ABI version, as an explicit opt-in for platforms to use should they view the performance gain worth the non-conformance. libc++'s v2 ABI should by default conform to the specification as fully as possible.
Cc @dim @emaste as it pertains to libc++ in FreeBSD
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs