[PATCH] D139827: [RISCV][Asan] Use dynamic shadow offset to make it work on different width of virtual-memory system.

Kito Cheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 29 23:06:14 PST 2023


kito-cheng added a comment.

In D139827#4080074 <https://reviews.llvm.org/D139827#4080074>, @luismarques wrote:

> With the current (unpatched) LLVM tree on an RV64 SV39 host I get this ASAN test failure (for `check-asan`):
>
> - AddressSanitizer-riscv64-linux :: TestCases/memcmp_test.cpp
>
> With this patch on an RV64 SV48 host I get these test failures:
>
> - AddressSanitizer-riscv64-linux :: TestCases/Linux/syscalls.cpp
> - AddressSanitizer-riscv64-linux :: TestCases/Posix/bcmp_test.cpp
> - AddressSanitizer-riscv64-linux :: TestCases/strncpy-overflow.cpp
>
> I'll need to double-check if those results are actually correct but...
> @kito-cheng Does that match your test results? If not, what do you observe? If it matches, have you investigated the new test failures?

Just back from Chinese new year vocation :P let me check with my local test environment again, thanks for testing and reporting this.



================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:1119
+  // RISC-V also has multiple address space layouts: 32, 39, 48 and 57,
+  // default is 47-bit for RISCV64.
   return (1ULL << (MostSignificantSetBitIndex(GET_CURRENT_FRAME()) + 1)) - 1;
----------------
luismarques wrote:
> The "default is 47-bit for RISCV64" is confusing, after listing "32, 39, 48 and 57". By that do you mean that Linux defaults to SV48? (if so fix 47->48). Or that the sanitizer defaults to a `1 << 47` userspace address range? Or both, or something else?
That's my stupid copy-and-paste error from AArch64, and my intention is support multiple address space layout.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139827/new/

https://reviews.llvm.org/D139827



More information about the llvm-commits mailing list