This patch addresses https://bugs.llvm.org/show_bug.cgi?id=47787 (and hence https://bugs.llvm.org/show_bug.cgi?id=47767 as well).
In latter instrumentation code, we always use the beginning of the alloca as the base for instrumentation, ignoring any offset into the alloca.
Because of that, we should only instrument a lifetime marker if it's actually pointing to the beginning of the alloca.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
1,130 ms | linux > libarcher.parallel::parallel-nosuppression.c |
Event Timeline
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | ||
---|---|---|
1083 | Similar problem is if the size of lifetime is smaller then alloca. | |
llvm/test/Instrumentation/AddressSanitizer/alloca-offset-lifetime.ll | ||
1 | Would you like to try to use llvm/utils/update_test_checks.py |
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | ||
---|---|---|
1083 | Is that a problem though? A lifetime marker should always be accurate, that is, if the marker indicates that only part of the region is alive, it should be ok to just mark that region alive? |
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | ||
---|---|---|
1083 | I will land this as it is for now. But please do let me know your thoughts on what we want to do when the size doesn't match. |
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | ||
---|---|---|
1083 | if marker can point with offset, skipping the beginning of the alloca, then I assume sooner or later something may generate code which will set size smaller then alloca, skipping the tail of it. |
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | ||
---|---|---|
1089–1091 |
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | ||
---|---|---|
1083 | Not sure if I follow, but my point is if the lifetime points to the beginning of the alloca, the generated instrumentation code will always be correct, and hence it's fine even the size may be smaller than the alloca size. |
Similar problem is if the size of lifetime is smaller then alloca.
Would you like to handle that case, here or in the another patch?