[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] [patch] Fix for fast unwind and tcmalloc not playing w
[Libunwind-devel] [patch] Fix for fast unwind and tcmalloc not playing well together.
Wed, 19 Oct 2011 16:08:41 -0700
I am now trying to use Lassi's fast trace, and the results are exceptionally
good: on some of my test cases the overhead of using libunwind (compared
to frame-based unwinder) went from 9x to 1.2x ;-)
One problem that cropped up: tcmalloc wants to record stack traces on free,
and this causes a crash when a thread is exiting.
Glibc calls thread-specific dtors in the order in which the keys were added,
so the first dtor is the trace_cache_free() one. Then thread-specific
data for some other key is free()d, which calls into unw_backtrace(),
which uses dangling cache and munmapped cache->frames.
1. delays destruction of trace cache to the last possible moment, and
2. clears tls_cache, so the dangling pointer will not be used.
Tested on Linux/x86_64 (Ubuntu 10.04); no new failures.
Description: Text document
- [Libunwind-devel] [patch] Fix for fast unwind and tcmalloc not playing well together.,
Paul Pluzhnikov <=