From: Daniel Barlow Date: Mon, 22 Sep 2003 23:01:13 +0000 (+0000) Subject: 0.8.3.87 X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=a93dc34ed9e7f5c7162e9c18961e6cce23941b46;p=sbcl.git 0.8.3.87 After vast effort (mostly Christophe's) we have a fix for the hangs in multithreaded CLX. Under some circumstances we could be trying to scavenge one thread's stack using the stack pointer from another: needless to say, this is not too effective. When sleeping on a queue, loop around sigwaitinfo restarting it until it stops returning EINTR --- diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index 3a7dccb..4061ae6 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -3687,10 +3687,12 @@ garbage_collect_generation(int generation, int raise) * handler, you will lose. */ for_each_thread(th) { void **ptr; - void **esp= (void **) &raise; + void **esp=(void **)-1; int i,free; #ifdef LISP_FEATURE_SB_THREAD - if(th!=arch_os_get_current_thread()) { + if(th==arch_os_get_current_thread()) { + esp = (void **) &raise; + } else { void **esp1; free=fixnum_value(SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX,th)); for(i=free-1;i>=0;i--) { @@ -3704,6 +3706,8 @@ garbage_collect_generation(int generation, int raise) } } } +#else + esp = (void **) &raise; #endif for (ptr = (void **)th->control_stack_end; ptr > esp; ptr--) { preserve_pointer(*ptr); diff --git a/src/runtime/thread.c b/src/runtime/thread.c index 80be925..ebdb2e4 100644 --- a/src/runtime/thread.c +++ b/src/runtime/thread.c @@ -3,6 +3,7 @@ #include #include #include +#include #ifndef CLONE_PARENT /* lameass glibc 2.2 doesn't define this */ #define CLONE_PARENT 0x00008000 /* even though the manpage documents it */ #endif @@ -282,7 +283,10 @@ void unblock_sigcont_and_sleep(void) sigset_t set; sigemptyset(&set); sigaddset(&set,SIGCONT); - sigwaitinfo(&set,0); + do { + errno=0; + sigwaitinfo(&set,0); + }while(errno==EINTR); sigprocmask(SIG_UNBLOCK,&set,0); } @@ -309,8 +313,8 @@ void gc_stop_the_world() * for them on each time around */ for(p=all_threads;p!=tail;p=p->next) { if(p==th) continue; - countdown_to_gc++; - kill(p->pid,SIG_STOP_FOR_GC); + countdown_to_gc++; + kill(p->pid,SIG_STOP_FOR_GC); } tail=all_threads; } else { diff --git a/version.lisp-expr b/version.lisp-expr index 351dffd..1a300b0 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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.3.86" +"0.8.3.87"