Re: Improvement to g_on_error_stack_trace [PATCH]



Tim Janik wrote:
> well, for production, it should be noted that these functions are
> 1) pretty non-portable, i.e. subject to fail on non-unix/non-gdb
>    systems
> 2) not extremely reliable, i.e. may fail with future gdb versions and
>    stand and fall with current gdb bugs
> 3) _can_ make a bad situation worse, e.g. by some gdb versions that tend
>    to suck memory like a black hole for corrupted stacks.

When building on a system with glibc 2.1 or later, why not use
backtrace() and friends (backtrace_symbols() and
backtrace_symbols_fd())?  See /usr/include/execinfo.h

I've used them something similar in TOM and it has worked well.

 - Bruce




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