[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 10:38:40 PST 2017
fjricci added a comment.
The stack trace from the debugger isn't particularly helpful:
thread #2, name = 'stack-use-after', stop reason = signal SIGSEGV: address access protected (fault address: 0x7ffff7e72020)
frame #0: stack-use-after-return.cc.tmp`Func1() at stack-use-after-return.cc:39
36 }
37
38 __attribute__((noinline))
-> 39 char *Func1() {
40 char local[kSize];
41 return Ident(local);
42 }
(lldb) bt all
thread #1, name = 'stack-use-after'
frame #0: libpthread.so.0`pthread_join(threadid=140737352574720, thread_return=0x0000000000000000) at pthread_join.c:92
frame #1: stack-use-after-return.cc.tmp`main at stack-use-after-return.cc:74
frame #2: libc.so.6`__libc_start_main(main=(stack-use-after-return.cc.tmp`main), argc=1, argv=0x00007fffffffdb78, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffdb68) at libc-start.c:287
frame #3: 0x000000000041ba7c stack-use-after-return.cc.tmp`_start + 41
* thread #2, name = 'stack-use-after', stop reason = signal SIGSEGV: address access protected (fault address: 0x7ffff7e72020)
* frame #0: stack-use-after-return.cc.tmp`Func1() at stack-use-after-return.cc:39
frame #1: stack-use-after-return.cc.tmp`Thread(void*) at stack-use-after-return.cc:61
frame #2: libpthread.so.0`start_thread(arg=0x00007ffff7e82700) at pthread_create.c:312
frame #3: libc.so.6`__clone at clone.S:111
The crash error also goes away if I add a CHECK(0); to GetAllocatorCache(), which is similarly strange.
Repository:
rL LLVM
https://reviews.llvm.org/D29994
More information about the llvm-commits
mailing list