[compiler-rt] Add aligned_alloc to macOS tsan interceptors (PR #79198)

Chris Apple via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 07:14:19 PST 2024


cjappl wrote:

Makes sense to me.

I am leaning towards keeping the test, as a way to ensure that this is caught into the future. Does that seem reasonable? I can then revert the forward declaration.

Is it worth adding a comment to the place in the code where `aligned_alloc` is excluded from apple to prevent someone like me going down this path in the future?

e.g. a comment here:
https://github.com/llvm/llvm-project/blob/70fc9703788e8965813c5b677a85cb84b66671b6/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp#L818-L824

```cpp
// On darwin systems, all the allocations are caught via the mechanism in sanitizer_malloc_mac_inc.
// This means we do not need to intercept them for APPLE, just non APPLE
```


Even in the original review we were trying to reason about why `aligned_alloc` wasn't intercepted, and we couldn't come to a good agreement:

https://github.com/llvm/llvm-project/pull/77543#issuecomment-1885803368

>  I am not 100% certain if there isn't a more tricky reason, but my guess for aligned_alloc not being intercepted is that simply no one has done the work to ensure it works yet.


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


More information about the llvm-commits mailing list