[compiler-rt] [TSan] Clarify and enforce shadow end alignment (PR #144648)

Marco Elver via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 2 04:28:05 PDT 2025


melver wrote:

> > Turning off the test case is unacceptable - that'd be a regression.
> > Could you explain why this commit introduced the regression?
> 
> This triggered test case `munmap_clear_shadow.c` was supposed to be part of this PR, but was separated into my other PR #145472, adhering to the review suggestion.
> 
> I did pass the test case in my environment of Linux/x86_64, but lacked consideration of other platforms. Therefore, it caused the test case to still be triggered in IOS as the cleared shadow is not set to 0 after `ReleaseMemoryPagesToOS`, and accordingly caused `__tsan_read1` to raise a race error in the test case, which is not my expectation.
> 
> > In IOS, it executes madvise(beg, end, MADV_FREE), which tags the relevant pages as 'FREE' and does not release them immediately.
> > In Linux, it executes madvise(beg, end, MADV_DONTNEED), releasing the pages immediately and setting them to 0.

Good point.

If this is a new test, feel free to disable it on iOS.

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


More information about the llvm-commits mailing list