Loading src/code/room.lisp +22 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,28 @@ (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)) Loading src/code/toplevel.lisp +2 −2 Original line number Diff line number Diff line Loading @@ -532,9 +532,9 @@ "~@<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"))))))))) Loading src/runtime/gencgc.c +1 −1 Original line number Diff line number Diff line Loading @@ -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) Loading src/runtime/interrupt.c +10 −3 Original line number Diff line number Diff line Loading @@ -544,7 +544,8 @@ 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)) { Loading @@ -553,10 +554,16 @@ sig_stop_for_gc_handler(int signal, siginfo_t *info, void *void_context) /* 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); } Loading src/runtime/thread.c +1 −1 Original line number Diff line number Diff line Loading @@ -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); } Loading Loading
src/code/room.lisp +22 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,28 @@ (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)) Loading
src/code/toplevel.lisp +2 −2 Original line number Diff line number Diff line Loading @@ -532,9 +532,9 @@ "~@<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"))))))))) Loading
src/runtime/gencgc.c +1 −1 Original line number Diff line number Diff line Loading @@ -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) Loading
src/runtime/interrupt.c +10 −3 Original line number Diff line number Diff line Loading @@ -544,7 +544,8 @@ 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)) { Loading @@ -553,10 +554,16 @@ sig_stop_for_gc_handler(int signal, siginfo_t *info, void *void_context) /* 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); } Loading
src/runtime/thread.c +1 −1 Original line number Diff line number Diff line Loading @@ -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); } Loading