libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libunwind-devel] [patch] Fix for crash in fasttrace during thread shutd


From: Paul Pluzhnikov
Subject: [Libunwind-devel] [patch] Fix for crash in fasttrace during thread shutdown
Date: Wed, 7 Dec 2011 08:43:14 -0800

Greetings,

One of my tests intermittently failed with the following stack trace:

#3  0x00000000029c2cea in FailureSignalHandler (signo=11,
si=0x2b3e119bb740, uc=0x2b3e119bb610)
#4  <signal handler called>
#5  trace_lookup () at src/x86_64/Gtrace.c:293
#6  _ULx86_64_tdep_trace () at src/x86_64/Gtrace.c:437
#7  0x00000000029ebdb2 in unw_backtrace () at src/mi/backtrace.c:73
#8  0x00000000029cdd4b in GetStackTraceWithContext ()
#9  0x00000000029c9ceb in sigprof_handler (sig=27,
signal_ucontext=0x2b3e119bca40, cpu_profiler=0x449c0e0)
#10 <signal handler called>
#11 0x00000000029ed686 in munmap () from /lib64/libc.so.6
#12 trace_cache_free () at src/x86_64/Gtrace.c:70
#13 0x00002b3e0e565c31 in start_thread () from /lib64/libpthread.so.0
#14 0x00002b3e0e7a253d in clone () from /lib64/libc.so.6


That is:
- the thread is exiting, and we are running thread-specific destructors,
- while we are munmap()ing the frame cache, SIGPROF arrives, and gets delivered
  during return from the munmap syscall,
- SIGPROF handler asks for a stack trace,
- since we have not yet reset tls_cache, we proceed to use it.
Kaboom!

Attached patch re-orders the steps and fixes that crash.

Google ref: b/5721767

Thanks,
-- 
Paul Pluzhnikov

Attachment: libunwind-fasttrace-crash-20111207.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]