[PATCH] D44579: [asan] Clean up some confusing code in `test/asan/TestCases/Darwin/segv_read_write.c`

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 12 09:40:35 PDT 2018


kubamracek added a comment.

In https://reviews.llvm.org/D44579#1160019, @delcypher wrote:

> In https://reviews.llvm.org/D44579#1044875, @eugenis wrote:
>
> > The comment makes sense to me. Writes are instrumented with reads from shadow in ASan. Therefore a write to addr in shadow will result in a read from shadow(addr), which is located in the mprotect-ed shadow gap, and will be reported as a read SEGV, not a write SEGV.
>


What I'm reading from the test is that we're accessing a normal address in normal app part of memory. This is backed by an ordinary byte in the shadow memory. The gap is not involved here at all. We know whether the faulty access is a read or write based because the instrumentation passes this information to `__asan_report_error`. I don't see how the comment is helpful.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D44579





More information about the llvm-commits mailing list