Index: lib/msan/tests/msan_test.cc =================================================================== --- lib/msan/tests/msan_test.cc +++ lib/msan/tests/msan_test.cc @@ -1883,7 +1883,7 @@ ASSERT_EQ(buff[1], '2'); ASSERT_EQ(buff[2], '3'); ASSERT_EQ(buff[6], '7'); - ASSERT_EQ(buff[7], 0); + ASSERT_EQ(buff[7], L'\0'); EXPECT_POISONED(buff[8]); } @@ -2886,6 +2886,8 @@ static const char basename[] = "libmsan_loadable.mips64.so"; #elif defined(__mips64) static const char basename[] = "libmsan_loadable.mips64el.so"; +#elif defined(__aarch64__) + static const char basename[] = "libmsan_loadable.aarch64.so"; #endif int res = snprintf(buf, sz, "%.*s/%s", (int)dir_len, program_path, basename); @@ -2992,6 +2994,14 @@ return 0; } +#ifdef PTHREAD_STACK_MIN +# define SMALLSTACKSIZE PTHREAD_STACK_MIN +# define SMALLPRESTACKSIZE PTHREAD_STACK_MIN +#else +# define SMALLSTACKSIZE 64 * 1024 +# define SMALLPRESTACKSIZE 16 * 1024 +#endif + TEST(MemorySanitizer, SmallStackThread) { pthread_attr_t attr; pthread_t t; @@ -2999,7 +3009,7 @@ int res; res = pthread_attr_init(&attr); ASSERT_EQ(0, res); - res = pthread_attr_setstacksize(&attr, 64 * 1024); + res = pthread_attr_setstacksize(&attr, SMALLSTACKSIZE); ASSERT_EQ(0, res); res = pthread_create(&t, &attr, SmallStackThread_threadfn, NULL); ASSERT_EQ(0, res); @@ -3016,7 +3026,7 @@ res = pthread_attr_init(&attr); ASSERT_EQ(0, res); void *stack; - const size_t kStackSize = 16 * 1024; + const size_t kStackSize = SMALLPRESTACKSIZE; res = posix_memalign(&stack, 4096, kStackSize); ASSERT_EQ(0, res); res = pthread_attr_setstack(&attr, stack, kStackSize);