0.pre8.105
authorDaniel Barlow <dan@telent.net>
Fri, 25 Apr 2003 23:43:07 +0000 (23:43 +0000)
committerDaniel Barlow <dan@telent.net>
Fri, 25 Apr 2003 23:43:07 +0000 (23:43 +0000)
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.

src/runtime/gencgc.c
src/runtime/interr.c
src/runtime/x86-linux-os.c
version.lisp-expr

index c231ae3..17064ee 100644 (file)
@@ -4194,8 +4194,20 @@ alloc(int nbytes)
        /* 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 b86e40f..e4df5ec 100644 (file)
@@ -46,7 +46,7 @@ never_returns
 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 9b46107..d943e6f 100644 (file)
@@ -20,6 +20,7 @@
 #include <sys/file.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <errno.h>
 
 #include "./signal.h"
 #include "os.h"
@@ -127,6 +128,11 @@ struct thread *arch_os_get_current_thread() {
     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
  * defunct.  Not called on live threads
index b2ac7fc..b5476c8 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.pre8.104"
+"0.pre8.105"