|
Boost : |
Subject: Re: [boost] [Backtrace] Any interest in portable stack trace?
From: Artyom (artyomtnk_at_[hidden])
Date: 2010-10-26 16:14:48
>
> This functionality would definitely be appreciated.
>
> Beware though, that gcc folks made a controversial decision to set "no
> frame pointer" flag as a default on 64bit POSIX.
Actually this is default on almost all compilers and platforms with even
minimal optimization. Including MSVC.
I've tried at the beginning naively walk on frame pointers and of course
failed with optimized versions.
> That also means that
> backtrace() will be either very inefficient (in my tests it was more
> than 100x slower than when the frame pointers are included)
I've tested and collecting backtrace on my quite deep project's stack that
actually gives
about 20 functions gives me on x86_64 and x85 /Linux, gcc-4.3 (different CPUs
for 32 and 64)
In one case I had thrown normal exception and in other exception with backtrace
collection.
Platform flags throw+bt throw frames collected
x86_64 -02 -g 50 mu 10mu 20
x86_64 -03 20 mu 7mu 11
x86 -02 -g 4mu 4mu 13
x86 -03 4mu 4mu 13
So it seems to be 5 times slower int throw in x86_64 using -g -O2 and
3 times slower when using -O3. IMHO it is tolerable difference for such
value.
> or unstable. It actually crashes sometimes.
> [...]
> Scary.
Can you give me more information about it? Do you have
any references? Because if backtrace crashes I would likely
just not use this feature and this library would not be actually created.
Artyom
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk