Jan Vroonhof <vroonhof(a)math.ethz.ch> writes:
Gunnar Evermann <ge204(a)eng.cam.ac.uk> writes:
> Incidentally is there any reason why we do not try to print some kind
> of C stacktrace from our signal handler?
Usual reason: Nobody wrote the patch. Boring but true.
OK, I can try doing it.
> The Sun Workshop version did that and sometimes it was really
> helpful.
That means the code is already somewhere for solaris...?
yes, in fatal_error_signal()
Basically it calls system("pstack <pid>"). It is currently #if 0'd --
Apparently Steve didn't like it. Steve: could you explain why?
> somewhat platform specific but I think at least for Solaris and
> linux/glibc it should be easy (didn't Ulrich post something about that
> some time ago?).
Yes. And W.Perry tried it on their in-house software. Maybe they can
be asked for help. (Note that this is for glibc 2.1 and up).
Actually I have just tried it and it's trivial to get the addresses.
The big problem is converting them into symbols. The only way seems to
involve 'addr2line' which is part of the gnu binutils...
At least we don't suffer from the "GDB development process
too slow
for Linux" aka "Linux changing its signal handler trampoline too
often" aka "short backtrace" problem.
well, I hope we won't just convert it into a "GNU binutils development
is too slow" problem. :-)
Gunnar