The current implementation of show_backtrace hangs on a mutex lock in the malloc/free routines when a segmentation fault due to corruption of the malloc/free administration happens to trigger the backtrace. There is an alternative implementation using a temporary file to store the translation of address -> symbol name that doesn't malloc storage (see 'man backtrace'). A work around is to force the hanging process to the background and using the "attach" functionality of gdb to force a backtrace with the "where" command.
Toon, do you have an example that shows this happening?
I'll try to come up with a bug report this week (the original case is much to complicated to use as an example). However, it might take some time and it also might be system dependent to trigger this event. It's clear, however, from the way you implemented the traceback feature that it is possible to hit this snag - it's just that not many people will hit it.
Frankly, this is a snag in a non-default debugging feature in rare conditions; that has to be a third-order enhancement request, at least! :) We cannot provide completely foolproof debugging capablities anyway: people who want to have the full power of debugging will be able to use gdb themselves. (Even with a temporary file, other things can go wrong!) I'd be in favour of closing this as WONTFIX, unless we have serious indication that this actually happens often in non mixed-language cases. Toon, what's your take?
I think that FX was right, since Toon has not responded in 6 months. Entering a WONTFIX Paul
> (Even with a temporary file, other things can go wrong!) Paul, you are right - I agree with FX, but forgot to reply. Closing as WONTFIX is OK with me.
Suggested patch by Janne (cf. PR 48931): http://gcc.gnu.org/ml/fortran/2011-05/msg00122.html