Subject: Re: [boost] tcmalloc and boost::diagnostic_information
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-06-14 00:04:56
Daniel Larimer wrote:
> I have some code that works fine on Mac OS X. I then switched it to use tcmalloc and it crashes when I attempt to use boost::diagnostic_information to print out information about an exception.
> #0 0x00007fff81298886 in __kill ()
> #1 0x00007fff81338eae in abort ()
> #2 0x000000010076ece3 in TCMalloc_CRASH_internal () at spinlock.h:104
> #3 0x000000010076ee4b in TCMalloc_CrashReporter::PrintfAndDie () at spinlock.h:104
> #4 0x000000010076c586 in (anonymous namespace)::InvalidFree (ptr=<value temporarily unavailable, due to optimizations>) at src/tcmalloc.cc:372
> #5 0x000000010004171a in boost::units::detail::demangle (name=0x100258ac0 "N5boost16exception_detail10clone_implIN2fl5error14future_timeoutEEE") at utility.hpp:48
> #6 0x0000000100046456 in boost::exception_detail::diagnostic_information_impl (be=0x101b00080, se=0x101b00070, with_what=true) at diagnostic_information.hpp:140
> #7 0x00000001000466b9 in boost::diagnostic_information<boost::exception> (e=@0x101b00080) at diagnostic_information.hpp:156
> Has anyone here seen this problem? I do not know whether this is a bug with tcmalloc or boost, but I would really like to use tcmalloc because it gives me a 10-50% performance increase when I am not throwing exceptions.
I think __cxa_demangle is using glibc's malloc implementation,
but free is calling tcmalloc. I have no idea how to make
__cxa_demangle work with tcmalloc.
P.S. Why is boost::exception calling into boost::units::detail?
Should I push demangle into boost::detail?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk