[PATCH] D29994: Use pthreads for thread-local lsan allocator cache on darwin
Francis Ricci via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 22 11:58:25 PST 2017
fjricci added a comment.
I found something very odd and very relevant. I added a line in `test-use-after-return.cc` to call `pthread_attr_getstacksize` immediately after `pthread_attr_setstacksize`. On master, the returned stack size is `8388608`. With my change, it's `65536`. I assume this means that we're intercepting something inside call to `pthread_attr_setstacksize`. But regardless, this means that `65536` was not large enough to begin with, unless we expect the sanitizers to intercept that call and increase the stack size. I assume we don't, since there's no direct interceptor for `pthread_attr_setstacksize`.
My diff is:
int main(int argc, char **argv) {
pthread_attr_init(&attr);
if (kStackSize > 0)
pthread_attr_setstacksize(&attr, kStackSize);
+ size_t stacksize = 0;
+ pthread_attr_getstacksize(&attr, &stacksize);
+ printf("stacksize: %lu\n", stacksize);
pthread_t t;
pthread_create(&t, &attr, Thread, 0);
pthread_attr_destroy(&attr);
Repository:
rL LLVM
https://reviews.llvm.org/D29994
More information about the llvm-commits
mailing list