>>>> "G" == Georg Nikodym
<georgn(a)canada.sun.com> writes:
>>>> "GE" == Gunnar Evermann
<ge204(a)eng.cam.ac.uk> writes:
GE> yes, in fatal_error_signal()
GE> Basically it calls system("pstack <pid>"). It is currently #if
GE> 0'd -- Apparently Steve didn't like it. Steve: could you explain
GE> why?
G> I believe he felt it didn't work all the time or something. I've
G> attached a test program that demonstrates the concept. If enough of
G> you run it and don't have any problems, it's probably safe to remove
G> the ifdefs (remember, though, that the pstack command did not appear
G> until Solaris 2.5.1).
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. It
would have been nice if Steve indicated WHY this code is #if'ed out.
# if 0 /* This is evil, rarely useful, and causes grief in some cases. */
/* Check for Sun-style stack printing via /proc */
{
CONST char *pstack = "/usr/proc/bin/pstack";
if (access (pstack, X_OK) == 0)
{
char buf[100];
stderr_out ("\nC backtrace follows:\n"
"(A real debugger may provide better information)\n\n");
sprintf (buf, "%s %d >&2", pstack, (int)getpid());
system (buf);
}
}
# endif