[PATCH] D52249: [hwasan] Record and display stack history in stack-based reports.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 21 18:15:58 PDT 2018


eugenis added inline comments.


================
Comment at: compiler-rt/lib/hwasan/hwasan_thread_list.h:22
+// sized region below and adjacent to the shadow region.
+// * Each ring buffer has a size of (2**N)*4096 where N is in [0, 8), and is
+// aligned to twice its size. The value of N can be different for each buffer.
----------------
kcc wrote:
> can N actually be 0? 
> If so, please add a run-time test, although I would rather say N is [1,8)
(2**0)*4096 == 4096, sure that will work.


================
Comment at: llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp:718
+    // must be aligned by twice that much. Therefore wrap around of the ring
+    // buffer is simply Addr &= ~((ThreadLong >> 56) << 10).
+    // The use of AShr instead of LShr is due to
----------------
kcc wrote:
> 10, not 12? 
ouch


https://reviews.llvm.org/D52249





More information about the llvm-commits mailing list