[PATCH] [sanitizer] Fix kThreadDescriptorSize for glibc <= 2.11.

Sergey Matveev earthdok at google.com
Mon Jun 3 02:32:52 PDT 2013


Hi kcc, glider,

Address issue reported by Greg Fitzgerald.

http://llvm-reviews.chandlerc.com/D907

Files:
  lib/sanitizer_common/sanitizer_linux_libcdep.cc

Index: lib/sanitizer_common/sanitizer_linux_libcdep.cc
===================================================================
--- lib/sanitizer_common/sanitizer_linux_libcdep.cc
+++ lib/sanitizer_common/sanitizer_linux_libcdep.cc
@@ -195,7 +195,12 @@
 
 #if defined(__x86_64__) || defined(__i386__)
 // sizeof(struct thread) from glibc.
+#if (__GLIBC__ == 2) && (__GLIBC_MINOR__ <= 11)
+// There has been a report of this being different on glibc 2.11. 
+const uptr kThreadDescriptorSize = FIRST_32_SECOND_64(1168, 2304);
+#else
 const uptr kThreadDescriptorSize = FIRST_32_SECOND_64(1216, 2304);
+#endif
 
 uptr ThreadDescriptorSize() {
   return kThreadDescriptorSize;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D907.1.patch
Type: text/x-patch
Size: 668 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130603/d5dde88e/attachment.bin>


More information about the llvm-commits mailing list