https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116243

Aiden Grossman <agrossman154 at yahoo dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |agrossman154 at yahoo dot com

--- Comment #5 from Aiden Grossman <agrossman154 at yahoo dot com> ---
Around the time this bug was filed libc++ enabled asan annotations inside of
std::string for SSO strings.

This initially caused some problems around clang inserting speculative loads of
the std::string object, which would trip up asan if some of the bytes within
the SSO buffer were poisoned, which they would be for SSO strings not exactly
at capacity of the buffer. This was eventually worked around within std::string
by just adding some inline asm to prevent insertion of speculative loads.

We also saw this occur with a std::string stored inside of a std::variant which
one cannot prevent in the general case with just modifications to std::string.
Overall discussion in https://github.com/llvm/llvm-project/pull/184693 is
probably relevant.

TLDR: ASAN annotations on non-SSO strings make sense. ASAN annotations on SSO
strings require more careful consideration. It looks like we (LLVM/libc++) are
going to disable them.
  • [Bug libstdc++/116243] Add ASAN... agrossman154 at yahoo dot com via Gcc-bugs

Reply via email to