Martin Buchholz <martin(a)xemacs.org> writes:
I wrote the code that called pstack, originally. Observe that I was
careful enough to check for the existence of the executable. Perhaps
the problem is that XEmacs is in a possibly broken state, having just
crashed, and so even things like calling access() is dangerous.
In that case wouldn't it be possible to do that check (and maybe even
the sprintf) unconditionally early on in main() and set some variable
like pstack_available_p. That would only leave the system() in the
signal handler. Of course this variable could potentially be
overwritten by the crash but that's probably rather unlikely to
happen.
What happens if pstack finds an utterly corrupted stack. Can it crash
or (worse) hang?
It would have been nice if Steve indicated WHY this code is
#if'ed
out.
yes, indeed.
# if 0 /* This is evil, rarely useful, and causes grief in some
cases. */
FWIW the ChangeLog entry says:
Wed Mar 12 14:29:40 1997 Steven L Baur <steve(a)altair.xemacs.org>
* emacs.c (fatal_error_signal): (mostly) useless check on
/usr/proc/bin/pstack removed.
Not much better, is it? :-)
The only problem with these pstack traces is that they might
discourage people from obtaining a real backtrace with their debugger
from the core, but that's a risk I'm willing to take. I see comments
like 'I couldn't find the core file' far too often and many people
don't even bother reading our crash message but just send it verbatim
to us. The more useful info we put in there the better.
Gunnar
--
Gunnar Evermann
Speech, Vision & Robotics Group
Engineering Department
Cambridge University