From 63cecb3653ca7b6edad6d6a56844b53cce9d24d5 Mon Sep 17 00:00:00 2001 From: Sagar Thakur Date: Fri, 26 Feb 2016 05:56:54 +0000 Subject: [PATCH] [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 llvm-svn: 261980 --- compiler-rt/lib/msan/msan_interceptors.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler-rt/lib/msan/msan_interceptors.cc b/compiler-rt/lib/msan/msan_interceptors.cc index 26e3eb426c69..1683a886e950 100644 --- a/compiler-rt/lib/msan/msan_interceptors.cc +++ b/compiler-rt/lib/msan/msan_interceptors.cc @@ -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);