0.8.7.29:
authorWilliam Harold Newman <william.newman@airmail.net>
Thu, 29 Jan 2004 04:09:31 +0000 (04:09 +0000)
committerWilliam Harold Newman <william.newman@airmail.net>
Thu, 29 Jan 2004 04:09:31 +0000 (04:09 +0000)
merged dan_b patches from sbcl-devel 2004-01-22:
"GC fixes: splay.lisp and SIGSTOP"
"Another one for the collection [bug 108]"

src/code/room.lisp
src/code/toplevel.lisp
src/runtime/gencgc.c
src/runtime/interrupt.c
src/runtime/thread.c
version.lisp-expr

index 0faffae..43f552e 100644 (file)
        (size (primitive-object-size obj)))
     (cond
      ((not lowtag))
+     (;; KLUDGE described in dan_b message "Another one for the
+      ;; collection [bug 108]" (sbcl-devel 2004-01-22)
+      ;;
+      ;; In a freshly started SBCL 0.8.7.20ish, (TIME (ROOM T))  causes
+      ;;   debugger invoked on a SB-INT:BUG in thread 5911:
+      ;;     failed AVER: "(SAP= CURRENT END)"
+      ;; [WHN: Similar things happened on one but not the other of my
+      ;; machines when I just run ROOM a lot in a loop.]
+      ;;
+      ;; This appears to be due to my [DB] abuse of the primitive
+      ;; object macros to define a thread object that shares a lowtag
+      ;; with fixnums and has no widetag: it looks like the code that
+      ;; generates *META-ROOM-INFO* infers from this that even fixnums
+      ;; are thread-sized - probably undesirable.
+      ;;
+      ;; This [the fix; the EQL NAME 'THREAD clause here] is more in the
+      ;; nature of a workaround than a really good fix. I'm not sure
+      ;; what a really good fix is: I /think/ it's probably to remove
+      ;; the :LOWTAG option in DEFINE-PRIMITIVE-OBJECT THREAD, then teach
+      ;; genesis to generate the necessary OBJECT_SLOT_OFFSET macros
+      ;; for assembly source in the runtime/genesis/*.h files.
+      (eql name 'thread))
      ((not widetag)
       (let ((info (make-room-info :name name
                                  :kind :lowtag))
index 03f4c34..745d2cc 100644 (file)
                "~@<Reduce debugger level (leaving debugger, returning to toplevel).~@:>")
             (catch 'toplevel-catcher
               (sb!unix::reset-signal-mask)
-              ;; in the event of a control-stack-exhausted-error, we
+              ;; In the event of a control-stack-exhausted-error, we
               ;; should have unwound enough stack by the time we get
-              ;; here that this is now possible
+              ;; here that this is now possible.
               (sb!kernel::protect-control-stack-guard-page 1)
               (funcall repl-fun noprint)
               (critically-unreachable "after REPL")))))))))
index 5914f6f..b31bc72 100644 (file)
@@ -2752,7 +2752,7 @@ scavenge_newspace_generation_one_scan(int generation)
           "/starting one full scan of newspace generation %d\n",
           generation));
     for (i = 0; i < last_free_page; i++) {
-       /* note that this skips over open regions when it encounters them */
+       /* Note that this skips over open regions when it encounters them. */
        if ((page_table[i].allocated & BOXED_PAGE)
            && (page_table[i].bytes_used != 0)
            && (page_table[i].gen == generation)
index aecee17..26b496a 100644 (file)
@@ -544,19 +544,26 @@ sig_stop_for_gc_handler(int signal, siginfo_t *info, void *void_context)
     os_context_t *context = arch_os_get_context(&void_context);
     struct thread *thread=arch_os_get_current_thread();
     struct interrupt_data *data=thread->interrupt_data;
-
+    sigset_t ss;
+    int i;
     
     if(maybe_defer_handler(sig_stop_for_gc_handler,data,
-                          signal,info,context)){
+                          signal,info,context)) {
        return;
     }
     /* need the context stored so it can have registers scavenged */
     fake_foreign_function_call(context); 
 
+    sigemptyset(&ss);
+    for(i=1;i<NSIG;i++) sigaddset(&ss,i); /* Block everything. */
+    sigprocmask(SIG_BLOCK,&ss,0);
+
     get_spinlock(&all_threads_lock,thread->pid);
     thread->state=STATE_STOPPED;
     release_spinlock(&all_threads_lock);
-    kill(thread->pid,SIGSTOP);
+
+    sigemptyset(&ss); sigaddset(&ss,SIG_STOP_FOR_GC);
+    sigwaitinfo(&ss,0);
 
     undo_fake_foreign_function_call(context);
 }
index 1169840..e4e5664 100644 (file)
@@ -347,7 +347,7 @@ void gc_start_the_world()
     for(p=all_threads;p;p=p->next) {
        if(p==th) continue;
        p->state=STATE_RUNNING;
-       kill(p->pid,SIGCONT);
+       kill(p->pid,SIG_STOP_FOR_GC);
     }
     release_spinlock(&all_threads_lock);
 }
index 61fd9ca..e57b46e 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.8.7.28"
+"0.8.7.29"