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

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 08:17:08 PST 2023


luismarques added a comment.

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?



================
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;
----------------
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?


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