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

Shabnam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 7 15:08:59 PST 2023


shabnam4b added inline comments.


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_platform.h:310
+// this will not work correctly on Sv57.
+#  define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 47)
 #elif defined(__aarch64__)
----------------
Just out of curiosity, why can't we modify the code for SV57 here which I assume works for Sv48 and SV39? Maybe there is no way to test it?
I ran this patch on Qemu as well as Docker (Qemu user) and it worked.
The only thing on testing with docker was when the code does not have a bug, it prints the output but it generates a log for a fatal error:


```
root at 74c2d5eadeed:/llvm-project/build# ./nobug
string is: Hello world!
==76543==LeakSanitizer has encountered a fatal error.
==76543==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==76543==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
```


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