Backtrace, malloc, other horrors
How nice, backtrace() as of glibc 2.3.4 uses malloc(). As one can see from the bug report it is unlikely to be fixed any time soon. Yay Ulrich! For the uninitiated, backtrace() allows you to get a backtrace from inside your own code - quite handy to stick in a SIGSEGV handler. However, if you are in a SIGSGEV handler, you really do not want to be trying to allocate dynamic memory (this is what malloc does) as your stack has to be pretty knackered to trigger a segfault. So this makes backtrace() more or less useless.
Labels: argh my eyes, backtrace, glibc


