[libcxx-commits] [PATCH] D122864: [libc++] Avoid lifetime UB in __thread_local_data()

Vitaly Buka via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 11 12:12:20 PDT 2022


vitalybuka marked an inline comment as done.
vitalybuka added a comment.

In D122864#3442952 <https://reviews.llvm.org/D122864#3442952>, @ldionne wrote:

> Thanks for the patch! I'm not sure I understand how we'd catch this though, since D122869 <https://reviews.llvm.org/D122869> doesn't touch any libc++ tests. Is there something we can do to fix our test setup in libc++ so as to catch this issue in our own tests?

I am not sure as well. Do we have bot which runs libc++ tests with sanitizers?
My team runs some clang/llvm tests with msan and instrumented libc++, but no libc++ tests.

WDYT about:

  __thread_specific_ptr::~__thread_specific_ptr() {
    destroyed = true;
  }
  
  __thread_specific_ptr::get() {
    _LIBCPP_ASSERT(!destroyed, ...
  }

and then I can try to add test to simulated this behavior?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122864/new/

https://reviews.llvm.org/D122864



More information about the libcxx-commits mailing list