From: Daniel B. <da...@us...> - 2003-04-25 23:43:11
|
Update of /cvsroot/sbcl/sbcl/src/runtime In directory sc8-pr-cvs1:/tmp/cvs-serv3857/src/runtime Modified Files: gencgc.c interr.c x86-linux-os.c Log Message: 0.pre8.105 Add #include <errno.h>, for +sb-threads builds on some Linux distros in which the existing include files don't seem to have dragged it in already Change the PSEUDO_ATOMIC_ATOMIC assert in alloc to print more detail. If you run into this bug, sbcl-devel wants to know. Index: gencgc.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/gencgc.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- gencgc.c 20 Apr 2003 03:39:48 -0000 1.31 +++ gencgc.c 25 Apr 2003 23:43:08 -0000 1.32 @@ -4194,8 +4194,20 @@ /* there are a few places in the C code that allocate data in the * heap before Lisp starts. This is before interrupts are enabled, * so we don't need to check for pseudo-atomic */ - gc_assert(SymbolValue(PSEUDO_ATOMIC_ATOMIC,th)); - +#ifdef LISP_FEATURE_SB_THREAD + if(!SymbolValue(PSEUDO_ATOMIC_ATOMIC,th)) { + register u32 fs; + fprintf(stderr, "fatal error in thread 0x%x, pid=%d\n", + th,getpid()); + __asm__("movl %fs,%0" : "=r" (fs) : ); + fprintf(stderr, "fs is %x, th->tls_cookie=%x (should be identical)\n", + debug_get_fs(),th->tls_cookie); + lose("If you see this message before 2003.05.01, mail details to sbcl-devel\n"); + } +#else + gc_assert(SymbolValue(PSEUDO_ATOMIC_ATOMIC,th)); +#endif + /* maybe we can do this quickly ... */ new_free_pointer = region->free_pointer + nbytes; if (new_free_pointer <= region->end_addr) { Index: interr.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/interr.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- interr.c 27 Feb 2003 00:50:01 -0000 1.8 +++ interr.c 25 Apr 2003 23:43:08 -0000 1.9 @@ -46,7 +46,7 @@ lose(char *fmt, ...) { va_list ap; - fprintf(stderr, "fatal error encountered in SBCL pid %d\n",getpid()); + fprintf(stderr, "fatal error encountered in SBCL pid %d",getpid()); if (fmt) { fprintf(stderr, ":\n"); va_start(ap, fmt); Index: x86-linux-os.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/x86-linux-os.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- x86-linux-os.c 19 Apr 2003 23:19:16 -0000 1.12 +++ x86-linux-os.c 25 Apr 2003 23:43:08 -0000 1.13 @@ -20,6 +20,7 @@ #include <sys/file.h> #include <sys/types.h> #include <unistd.h> +#include <errno.h> #include "./signal.h" #include "os.h" @@ -126,6 +127,11 @@ #else return all_threads; #endif +} +struct thread *debug_get_fs() { + register u32 fs; + __asm__("movl %%fs,%0" : "=r" (fs) : ); + return fs; } /* free any arch/os-specific resources used by thread, which is now |