[compiler-rt] r261980 - [MSAN] Fix test SmallPreAllocatedStackThread for MIPS

Sagar Thakur via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 21:56:54 PST 2016


Author: slthakur
Date: Thu Feb 25 23:56:54 2016
New Revision: 261980

URL: http://llvm.org/viewvc/llvm-project?rev=261980&view=rev
Log:
[MSAN] Fix test SmallPreAllocatedStackThread for MIPS

Summary: Msan was intercepting version 2.1 of the pthread_create function which was making it to crash in libc because __pthread_create_2_1 modifies the stack attributes of the thread. Intercepting the correct version fixes the test SmallPreAllocatedStackThread.

Reviewers: eugenis, samsonov
Subscribers: llvm-commits, mohit.bhakkad, jaydeep
Differential: http://reviews.llvm.org/D17603

Modified:
    compiler-rt/trunk/lib/msan/msan_interceptors.cc

Modified: compiler-rt/trunk/lib/msan/msan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interceptors.cc?rev=261980&r1=261979&r2=261980&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/msan/msan_interceptors.cc Thu Feb 25 23:56:54 2016
@@ -1629,7 +1629,11 @@ void InitializeInterceptors() {
   INTERCEPT_FUNCTION(getrusage);
   INTERCEPT_FUNCTION(sigaction);
   INTERCEPT_FUNCTION(signal);
+#if defined(__mips__)
+  INTERCEPT_FUNCTION_VER(pthread_create, "GLIBC_2.2");
+#else
   INTERCEPT_FUNCTION(pthread_create);
+#endif
   INTERCEPT_FUNCTION(pthread_key_create);
   INTERCEPT_FUNCTION(pthread_join);
   INTERCEPT_FUNCTION(tzset);




More information about the llvm-commits mailing list