X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fruntime%2Finterr.c;h=b86e40f46512d0d4fce7886a59cc5f6d4da0e2b5;hb=3bb2fb5b9ecdeebecaded4ac6e5af0f653be8867;hp=1fd412c706507226646b1b94998c6ca05d806c26;hpb=62272dd0e7254b19a484fa1a2050ba15504d3ece;p=sbcl.git diff --git a/src/runtime/interr.c b/src/runtime/interr.c index 1fd412c..b86e40f 100644 --- a/src/runtime/interr.c +++ b/src/runtime/interr.c @@ -15,6 +15,7 @@ #include #include +#include #include "arch.h" #include "signal.h" @@ -24,6 +25,8 @@ #include "interr.h" #include "print.h" #include "lispregs.h" +#include "genesis/static-symbols.h" +#include "genesis/vector.h" /* the way that we shut down the system on a fatal error */ @@ -43,7 +46,7 @@ never_returns lose(char *fmt, ...) { va_list ap; - fprintf(stderr, "fatal error encountered in SBCL runtime system"); + fprintf(stderr, "fatal error encountered in SBCL pid %d\n",getpid()); if (fmt) { fprintf(stderr, ":\n"); va_start(ap, fmt); @@ -152,6 +155,16 @@ describe_internal_error(os_context_t *context) lispobj debug_print(lispobj string) { - fprintf(stderr, "%s\n", (char *)(((struct vector *)PTR(string))->data)); + /* This is a kludge. It's not actually safe - in general - to use + %primitive print on the alpha, because it skips half of the + number stack setup that should usually be done on a function call, + so the called routine (i.e. this one) ends up being able to overwrite + local variables in the caller. Rather than fix this everywhere + that %primitive print is used (it's only a debugging aid anyway) + we just put guarantee our safety by putting an unused buffer on + the stack before doing anything else here */ + char untouched[32]; /* GCC warns about not using this, but that's the point.. */ + fprintf(stderr, "%s\n", + (char *)(((struct vector *)native_pointer(string))->data),untouched); return NIL; }