[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
Wed Apr 13 12:02:02 PDT 2022


vitalybuka added a comment.

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

> In D122864#3443536 <https://reviews.llvm.org/D122864#3443536>, @vitalybuka wrote:
>
>> 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.
>
> Yes, we run Asan, Tsan, Msan and UBsan on each patch in our pre-commit ci: https://buildkite.com/llvm-project/libcxx-ci/builds/10156. It looks like the patch as-is is failing under Msan, too.
>
> To detect this, perhaps we're just missing `-fsanitize-memory-use-after-dtor` in our test setup? Is it enabled by default?

It's not, also it needs env MSAN_OPTIONS=poison_in_dtor=1 
However those are good to be enabled by default, but it will break here and some other llvm places I need to fix.


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