[PATCH] Port LSan to ARM Linux

Kostya Serebryany kcc at google.com
Thu Apr 17 01:20:23 PDT 2014


  As noted in https://code.google.com/p/address-sanitizer/issues/detail?id=294#c3,
  lsan's job is much harder on 32-bit arch than on a 64-bit arch.
  Beware that on a 32-bit arch false negatives (missing a leak) are much more probable

  Do you have any plans on setting a public build bot for asan on ARM?


================
Comment at: lsan/lsan_allocator.cc:49
@@ +48,3 @@
+  ChunkTag tag : 2;
+  uptr requested_size : 22;
+  u32 stack_trace_id;
----------------
instead of duplicating this struct here, please move it out of ifdef and use FIRST_32_SECOND_64(54, 22)

Also, why do you think 22 bits is enough? 

================
Comment at: lsan/lsan_allocator.cc:58
@@ +57,3 @@
+
+#endif
+
----------------
#endif   // SANITIZER_WORDSIZE

================
Comment at: lsan/lsan_allocator.cc:60
@@ +59,3 @@
+
+static const uptr kMaxAllowedMallocSize = FIRST_32_SECOND_64(3UL << 27, 8UL << 30);
+
----------------
A comment explaining 3UL<<27 would be nice. I know 32-bit systems that can allocate more. 

================
Comment at: lsan/lsan_common.cc:251
@@ -251,1 +250,3 @@
+// TODO: implement for arm.
+#if defined(__x86_64__)
     if (flags()->use_tls) {
----------------
can you use if() instead of #ifdef? 
E.g. simply disable lags()->use_tls on arm? 


http://reviews.llvm.org/D3407






More information about the llvm-commits mailing list