[PATCH] [lsan] [mips] adding support of lsan for mips64/mips64el arch

Kumar Sukhani kumarsukhani at gmail.com
Fri Nov 14 02:51:12 PST 2014


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:835
@@ -834,2 +834,3 @@
   return res;
 }
+#elif defined(__mips__)
----------------
earthdok wrote:
> Where did clone go?
It was a mistake

================
Comment at: lib/sanitizer_common/sanitizer_linux_libcdep.cc:192
@@ +191,3 @@
+  // TODO(kumarsukhani): add more values as per different glibc versions
+  val = FIRST_32_SECOND_64(1152, 1760);
+  return val;
----------------
earthdok wrote:
> How did you obtain those numbers?
> 
> We need some kind of test for those, similar to SanitizerLinux.ThreadDescriptorSize (but taking into account the actual TLS layout on MIPS).
I obtained .i file by compiling GLIBC 2.19-13 (same which is available on my board), and calculated those values

================
Comment at: lib/sanitizer_common/sanitizer_linux_libcdep.cc:248
@@ +247,3 @@
+
+  const uptr kTlsTcbOffset = 0x7000;
+  const uptr kTcbHead = 16;
----------------
earthdok wrote:
> Only this constant is part of the ABI. kTcbHead and kTlsTcbAlign could theoretically change, so we need to test them as well.
> 
> Instead of ThreadDescriptorSize(), we probably want to expose TlsPreTcbSize(). But please figure out what the test will look like before making this change.
can we use test of minor number, the way x86_64 has done ?

================
Comment at: lib/sanitizer_common/sanitizer_printf.cc:116
@@ -115,3 +115,3 @@
   result += AppendUnsigned(buff, buff_end, ptr_value, 16,
-                           (SANITIZER_WORDSIZE == 64) ? 12 : 8, true);
+                           SANITIZER_POINTER_FORMAT_LENGTH, true);
   return result;
----------------
earthdok wrote:
> Accidental change?
no that change is already merged in http://reviews.llvm.org/D6024 patch

http://reviews.llvm.org/D5616






More information about the llvm-commits mailing list