[compiler-rt] [scudo] Add missing thread-safety analysis annotations. (PR #68072)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 16:47:00 PDT 2023


ChiaHungDuan wrote:

> > One quick question, why do we need to annotate `REQUIRES` capability here if we already mark it as `ASSERT_CAPABILITY`?
> > https://clang.llvm.org/docs/ThreadSafetyAnalysis.html#assert-capability-and-assert-shared-capability
> 
> My understanding is that `ASSERT_CAPABILITY` is a purely dynamic check, and does not imply `REQUIRES`. Adding @aaronpuchert for confirmation.

Just read the description again and I found that I misunderstood its meaning. 

```
... Presence of this annotation causes the analysis to assume the capability is held after calls to the annotated function ...
```

I thought it asserted *before* the calling of the function. 

I have prepared a fix #68273 and verified it with #67776. If you would like to submit a workaround first, I would suggest marking them as NO_THREAD_SAFETY_ANALYSIS and I will submit the fix later soon. Let me know which way you prefer

Thanks! 

https://github.com/llvm/llvm-project/pull/68072


More information about the llvm-commits mailing list