Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2000 |
Jan
|
Feb
(1) |
Mar
(11) |
Apr
|
May
(16) |
Jun
(5) |
Jul
(5) |
Aug
(27) |
Sep
(25) |
Oct
(10) |
Nov
(40) |
Dec
(40) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(78) |
Feb
(80) |
Mar
(35) |
Apr
(73) |
May
(97) |
Jun
(44) |
Jul
(38) |
Aug
(43) |
Sep
(94) |
Oct
(124) |
Nov
(13) |
Dec
(79) |
2002 |
Jan
(144) |
Feb
(68) |
Mar
(128) |
Apr
(117) |
May
(90) |
Jun
(63) |
Jul
(42) |
Aug
(66) |
Sep
(97) |
Oct
(89) |
Nov
(92) |
Dec
(88) |
2003 |
Jan
(101) |
Feb
(127) |
Mar
(103) |
Apr
(145) |
May
(211) |
Jun
(143) |
Jul
(67) |
Aug
(184) |
Sep
(212) |
Oct
(117) |
Nov
(181) |
Dec
(86) |
2004 |
Jan
(92) |
Feb
(95) |
Mar
(163) |
Apr
(242) |
May
(202) |
Jun
(114) |
Jul
(94) |
Aug
(148) |
Sep
(163) |
Oct
(111) |
Nov
(95) |
Dec
(133) |
2005 |
Jan
(148) |
Feb
(102) |
Mar
(213) |
Apr
(178) |
May
(202) |
Jun
(199) |
Jul
(189) |
Aug
(309) |
Sep
(126) |
Oct
(128) |
Nov
(148) |
Dec
(156) |
2006 |
Jan
(222) |
Feb
(184) |
Mar
(152) |
Apr
(176) |
May
(189) |
Jun
(186) |
Jul
(75) |
Aug
(182) |
Sep
(103) |
Oct
(144) |
Nov
(265) |
Dec
(197) |
2007 |
Jan
(175) |
Feb
(202) |
Mar
(212) |
Apr
(309) |
May
(203) |
Jun
(162) |
Jul
(207) |
Aug
(156) |
Sep
(136) |
Oct
(99) |
Nov
(199) |
Dec
(201) |
2008 |
Jan
(190) |
Feb
(201) |
Mar
(180) |
Apr
(132) |
May
(204) |
Jun
(149) |
Jul
(125) |
Aug
(102) |
Sep
(86) |
Oct
(269) |
Nov
(167) |
Dec
(291) |
2009 |
Jan
(155) |
Feb
(119) |
Mar
(174) |
Apr
(186) |
May
(168) |
Jun
(217) |
Jul
(107) |
Aug
(134) |
Sep
(111) |
Oct
(184) |
Nov
(81) |
Dec
(140) |
2010 |
Jan
(91) |
Feb
(93) |
Mar
(132) |
Apr
(137) |
May
(86) |
Jun
(112) |
Jul
(38) |
Aug
(112) |
Sep
(111) |
Oct
(124) |
Nov
(52) |
Dec
(49) |
2011 |
Jan
(72) |
Feb
(115) |
Mar
(91) |
Apr
(38) |
May
(119) |
Jun
(129) |
Jul
(34) |
Aug
(140) |
Sep
(37) |
Oct
(58) |
Nov
(130) |
Dec
(59) |
2012 |
Jan
(20) |
Feb
(9) |
Mar
(41) |
Apr
(89) |
May
(69) |
Jun
(21) |
Jul
(14) |
Aug
(24) |
Sep
(52) |
Oct
(49) |
Nov
(45) |
Dec
(21) |
2013 |
Jan
(36) |
Feb
(53) |
Mar
(50) |
Apr
(142) |
May
(125) |
Jun
(120) |
Jul
(89) |
Aug
(82) |
Sep
(45) |
Oct
(104) |
Nov
(69) |
Dec
(40) |
2014 |
Jan
(28) |
Feb
(85) |
Mar
(99) |
Apr
(108) |
May
(92) |
Jun
(73) |
Jul
(49) |
Aug
(65) |
Sep
(48) |
Oct
(61) |
Nov
(34) |
Dec
(41) |
2015 |
Jan
(84) |
Feb
(46) |
Mar
(81) |
Apr
(83) |
May
(56) |
Jun
(27) |
Jul
(47) |
Aug
(30) |
Sep
(31) |
Oct
(57) |
Nov
(65) |
Dec
(90) |
2016 |
Jan
(52) |
Feb
(71) |
Mar
(76) |
Apr
(37) |
May
(43) |
Jun
(16) |
Jul
(17) |
Aug
(51) |
Sep
(48) |
Oct
(40) |
Nov
(21) |
Dec
(36) |
2017 |
Jan
(40) |
Feb
(57) |
Mar
(47) |
Apr
(45) |
May
(28) |
Jun
(30) |
Jul
(53) |
Aug
(71) |
Sep
(48) |
Oct
(58) |
Nov
(42) |
Dec
(49) |
2018 |
Jan
(94) |
Feb
(50) |
Mar
(59) |
Apr
(33) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
1
|
2
|
3
(3) |
4
(2) |
5
(4) |
6
(8) |
7
(5) |
8
(2) |
9
(2) |
10
(4) |
11
(2) |
12
|
13
(4) |
14
(7) |
15
(1) |
16
(1) |
17
(3) |
18
|
19
(4) |
20
(2) |
21
|
22
|
23
(3) |
24
(2) |
25
(1) |
26
|
27
(7) |
28
(7) |
29
(4) |
30
(13) |
31
|
|
|
From: Cyrus Harmon <ch-sbcl@bo...> - 2011-03-07 20:44:15
|
Hi Willem, I hope you don't mind, but I'm going to break this up and commit the patch (or functional equivalents to it) in bite size pieces, which should help us track down precisely where things go awry, should there be any problems with the patch. thanks again, Cyrus On Mar 7, 2011, at 2:57 AM, Willem Rein Oudshoorn wrote: > Cyrus Harmon <ch-sbcl@...> writes: > >> Hrm... building with sb-after-xc-core gets most of the way there, but fails in sb-posix: >> >> SB-POSIX-TESTS::FILENAME-DESIGNATOR.1 SB-POSIX-TESTS::OPEN.1 >> fatal error encounteredfatal error encountered in SBCL pid 35147 in SBCL pid 35147(tid 140735080524960)(tid 2953854976): >> : >> mach_port_allocate_name failed with return_code 268435459 >> mach_msg_server returned > > This issue is fixed by merging your patch with mine. > The reason it failed in my patch is: > - the mach_task_self is cached > - sb-posix:fork code forks and inherits the cached value. > Your fix did not have this issue because sb-posix:fork calls > (setup-mach-exceptions) > which takes care of setting the right task port in the child process. > > I have attached an updated patch. > > diff --git a/src/runtime/darwin-os.c b/src/runtime/darwin-os.c > index 4a2bef6..236c9b0 100644 > --- a/src/runtime/darwin-os.c > +++ b/src/runtime/darwin-os.c > @@ -24,6 +24,10 @@ > #include <errno.h> > #include <dlfcn.h> > > +#ifdef LISP_FEATURE_MACH_EXCEPTION_HANDLER > +mach_port_t current_mach_task = MACH_PORT_NULL; > +#endif > + > char * > os_get_runtime_executable_path(int external) > { > @@ -37,4 +41,3 @@ os_get_runtime_executable_path(int external) > > return copied_string(path); > } > - > diff --git a/src/runtime/darwin-os.h b/src/runtime/darwin-os.h > index 9228d1b..f40d8e1 100644 > --- a/src/runtime/darwin-os.h > +++ b/src/runtime/darwin-os.h > @@ -30,6 +30,10 @@ typedef struct ucontext os_context_t; > typedef ucontext_t os_context_t; > #endif > > +#ifdef LISP_FEATURE_MACH_EXCEPTION_HANDLER > +extern mach_port_t current_mach_task; > +#endif > + > #define SIG_MEMORY_FAULT SIGBUS > > #define SIG_STOP_FOR_GC (SIGUSR2) > diff --git a/src/runtime/thread.c b/src/runtime/thread.c > index 535263a..88048ae 100644 > --- a/src/runtime/thread.c > +++ b/src/runtime/thread.c > @@ -29,6 +29,7 @@ > #include <mach/mach.h> > #include <mach/mach_error.h> > #include <mach/mach_types.h> > +#include "darwin-os.h" > #endif > > #include "runtime.h" > @@ -318,12 +319,12 @@ new_thread_trampoline(struct thread *th) > > #ifdef LISP_FEATURE_MACH_EXCEPTION_HANDLER > FSHOW((stderr, "Deallocating mach port %x\n", THREAD_STRUCT_TO_EXCEPTION_PORT(th))); > - mach_port_move_member(mach_task_self(), > + mach_port_move_member(current_mach_task, > THREAD_STRUCT_TO_EXCEPTION_PORT(th), > MACH_PORT_NULL); > - mach_port_deallocate(mach_task_self(), > + mach_port_deallocate(current_mach_task, > THREAD_STRUCT_TO_EXCEPTION_PORT(th)); > - mach_port_destroy(mach_task_self(), > + mach_port_destroy(current_mach_task, > THREAD_STRUCT_TO_EXCEPTION_PORT(th)); > #endif > > diff --git a/src/runtime/x86-64-darwin-os.c b/src/runtime/x86-64-darwin-os.c > index 00da75f..af14c46 100644 > --- a/src/runtime/x86-64-darwin-os.c > +++ b/src/runtime/x86-64-darwin-os.c > @@ -478,7 +478,8 @@ catch_exception_raise(mach_port_t exception_port, > #ifdef LISP_FEATURE_SB_THREAD > thread_mutex_unlock(&mach_exception_lock); > #endif > - return KERN_SUCCESS; > + ret = KERN_SUCCESS; > + break; > > case EXC_BAD_INSTRUCTION: > > @@ -570,14 +571,21 @@ catch_exception_raise(mach_port_t exception_port, > #ifdef LISP_FEATURE_SB_THREAD > thread_mutex_unlock(&mach_exception_lock); > #endif > - return KERN_SUCCESS; > + ret = KERN_SUCCESS; > + break; > > default: > #ifdef LISP_FEATURE_SB_THREAD > thread_mutex_unlock(&mach_exception_lock); > #endif > - return KERN_INVALID_RIGHT; > + ret = KERN_INVALID_RIGHT; > } > + > + mach_port_deallocate (current_mach_task, exception_port); > + mach_port_deallocate (current_mach_task, thread); > + mach_port_deallocate (current_mach_task, task); > + > + return ret; > } > > void * > @@ -604,8 +612,10 @@ setup_mach_exception_handling_thread() > pthread_t mach_exception_handling_thread = NULL; > pthread_attr_t attr; > > + current_mach_task = mach_task_self (); > + > /* allocate a mach_port for this process */ > - ret = mach_port_allocate(mach_task_self(), > + ret = mach_port_allocate(current_mach_task, > MACH_PORT_RIGHT_PORT_SET, > &mach_exception_handler_port_set); > > @@ -630,11 +640,13 @@ kern_return_t > mach_thread_init(mach_port_t thread_exception_port) > { > kern_return_t ret; > + mach_port_t thread_self; > + > /* allocate a named port for the thread */ > > FSHOW((stderr, "Allocating mach port %x\n", thread_exception_port)); > > - ret = mach_port_allocate_name(mach_task_self(), > + ret = mach_port_allocate_name(current_mach_task, > MACH_PORT_RIGHT_RECEIVE, > thread_exception_port); > if (ret) { > @@ -642,7 +654,7 @@ mach_thread_init(mach_port_t thread_exception_port) > } > > /* establish the right for the thread_exception_port to send messages */ > - ret = mach_port_insert_right(mach_task_self(), > + ret = mach_port_insert_right(current_mach_task, > thread_exception_port, > thread_exception_port, > MACH_MSG_TYPE_MAKE_SEND); > @@ -650,7 +662,8 @@ mach_thread_init(mach_port_t thread_exception_port) > lose("mach_port_insert_right failed with return_code %d\n", ret); > } > > - ret = thread_set_exception_ports(mach_thread_self(), > + thread_self = mach_thread_self (); > + ret = thread_set_exception_ports(thread_self, > EXC_MASK_BAD_ACCESS | EXC_MASK_BAD_INSTRUCTION, > thread_exception_port, > EXCEPTION_DEFAULT, > @@ -658,12 +671,13 @@ mach_thread_init(mach_port_t thread_exception_port) > if (ret) { > lose("thread_set_exception_port failed with return_code %d\n", ret); > } > + mach_port_deallocate (current_mach_task, thread_self); > > - ret = mach_port_move_member(mach_task_self(), > + ret = mach_port_move_member(current_mach_task, > thread_exception_port, > mach_exception_handler_port_set); > if (ret) { > - lose("mach_port_ failed with return_code %d\n", ret); > + lose("mach_port_move_member failed with return_code %d\n", ret); > } > > return ret; > diff --git a/src/runtime/x86-darwin-os.c b/src/runtime/x86-darwin-os.c > index ad41b0f..239f7a0 100644 > --- a/src/runtime/x86-darwin-os.c > +++ b/src/runtime/x86-darwin-os.c > @@ -502,6 +502,10 @@ catch_exception_raise(mach_port_t exception_port, > siginfo.si_addr = addr; > call_handler_on_thread(thread, &thread_state, signal, &siginfo, handler); > } > + mach_port_deallocate (current_mach_task, exception_port); > + mach_port_deallocate (current_mach_task, thread); > + mach_port_deallocate (current_mach_task, task); > + > return ret; > } > > @@ -533,8 +537,10 @@ setup_mach_exception_handling_thread() > pthread_t mach_exception_handling_thread = NULL; > pthread_attr_t attr; > > + current_mach_task = mach_task_self (); > + > /* allocate a mach_port for this process */ > - ret = mach_port_allocate(mach_task_self(), > + ret = mach_port_allocate(current_mach_task, > MACH_PORT_RIGHT_PORT_SET, > &mach_exception_handler_port_set); > > @@ -559,11 +565,13 @@ kern_return_t > mach_thread_init(mach_port_t thread_exception_port) > { > kern_return_t ret; > + mach_port_t thread_self; > + > /* allocate a named port for the thread */ > > FSHOW((stderr, "Allocating mach port %x\n", thread_exception_port)); > > - ret = mach_port_allocate_name(mach_task_self(), > + ret = mach_port_allocate_name(current_mach_task, > MACH_PORT_RIGHT_RECEIVE, > thread_exception_port); > if (ret) { > @@ -571,7 +579,7 @@ mach_thread_init(mach_port_t thread_exception_port) > } > > /* establish the right for the thread_exception_port to send messages */ > - ret = mach_port_insert_right(mach_task_self(), > + ret = mach_port_insert_right(current_mach_task, > thread_exception_port, > thread_exception_port, > MACH_MSG_TYPE_MAKE_SEND); > @@ -579,7 +587,8 @@ mach_thread_init(mach_port_t thread_exception_port) > lose("mach_port_insert_right failed with return_code %d\n", ret); > } > > - ret = thread_set_exception_ports(mach_thread_self(), > + thread_self = mach_thread_self (); > + ret = thread_set_exception_ports(thread_self, > EXC_MASK_BAD_ACCESS | EXC_MASK_BAD_INSTRUCTION, > thread_exception_port, > EXCEPTION_DEFAULT, > @@ -587,8 +596,9 @@ mach_thread_init(mach_port_t thread_exception_port) > if (ret) { > lose("thread_set_exception_port failed with return_code %d\n", ret); > } > + mach_port_deallocate (current_mach_task, thread_self); > > - ret = mach_port_move_member(mach_task_self(), > + ret = mach_port_move_member(current_mach_task, > thread_exception_port, > mach_exception_handler_port_set); > if (ret) { > > Wim Oudshoorn. > > ------------------------------------------------------------------------------ > What You Don't Know About Data Connectivity CAN Hurt You > This paper provides an overview of data connectivity, details > its effect on application quality, and explores various alternative > solutions. http://p.sf.net/sfu/progress-d2d_______________________________________________ > Sbcl-devel mailing list > Sbcl-devel@... > https://lists.sourceforge.net/lists/listinfo/sbcl-devel |
From: Jim Wise <jwise@dr...> - 2011-03-07 18:28:29
|
So, I've been testing sb-thread on SunOS/x86 -- unlike SunOS/x86-64, this platform has thread support written, and it's noted in the manual as working, but in need of testing. At this point, it builds and runs, but a couple tests blow up. The first set of failing tests is in contrib/sb-concurrency/test-mailbox.lisp. These tests fail in one of two ways -- either hanging, or hitting a panic due to waking up while waiting on a mailbox, but finding it empty on wakeup. The latter is more common, but both happen on different runs of the same tests. This whole block of tests is currently disabled for darwin due to similar issues, so I suspect this is actually a lutex-level issue. Barring objections, I'll change: #+(and sb-thread (not darwin)) on these tests to #+(and sb-thread (not sb-lutex)) for the time being, while digging further. The other test which fails is SYMBOL-VALUE-IN-THREAD.3 in tests/threads.pure.lisp. This test hangs indefinitely. This test is also currently marked as disabled on darwin, and again, barring objections, I'll change this to be disabled on sb-lutex platforms. I'm digging further, but as I do two quick questions: * Only darwin and sunos turn on sb-lutex by default. Do any other platforms support it? * Can linux sb-thread be built with sb-lutex, for comparison testing? * Any pointers on where to look? I can sort of trace this back to through the mutex code in sb-lutex, but any pointers are welcome * Any more notes/documentation on sb-lutex beyond what's in the internals manual and the internals wiki? Thanks, -- Jim Wise jwise@... |
From: Cyrus Harmon <ch-sbcl@bo...> - 2011-03-07 18:22:03
|
This is indeed much better. I was missing the deallocate calls in catch_exception_raise in my stuff. I think we're still leaking a send right here and there, but this is indeed much better, as evidenced by MachPortDump. thanks! Cyrus On Mar 7, 2011, at 2:57 AM, Willem Rein Oudshoorn wrote: > Cyrus Harmon <ch-sbcl@...> writes: > >> Hrm... building with sb-after-xc-core gets most of the way there, but fails in sb-posix: >> >> SB-POSIX-TESTS::FILENAME-DESIGNATOR.1 SB-POSIX-TESTS::OPEN.1 >> fatal error encounteredfatal error encountered in SBCL pid 35147 in SBCL pid 35147(tid 140735080524960)(tid 2953854976): >> : >> mach_port_allocate_name failed with return_code 268435459 >> mach_msg_server returned > > This issue is fixed by merging your patch with mine. > The reason it failed in my patch is: > - the mach_task_self is cached > - sb-posix:fork code forks and inherits the cached value. > Your fix did not have this issue because sb-posix:fork calls > (setup-mach-exceptions) > which takes care of setting the right task port in the child process. > > I have attached an updated patch. > > diff --git a/src/runtime/darwin-os.c b/src/runtime/darwin-os.c > index 4a2bef6..236c9b0 100644 > --- a/src/runtime/darwin-os.c > +++ b/src/runtime/darwin-os.c > @@ -24,6 +24,10 @@ > #include <errno.h> > #include <dlfcn.h> > > +#ifdef LISP_FEATURE_MACH_EXCEPTION_HANDLER > +mach_port_t current_mach_task = MACH_PORT_NULL; > +#endif > + > char * > os_get_runtime_executable_path(int external) > { > @@ -37,4 +41,3 @@ os_get_runtime_executable_path(int external) > > return copied_string(path); > } > - > diff --git a/src/runtime/darwin-os.h b/src/runtime/darwin-os.h > index 9228d1b..f40d8e1 100644 > --- a/src/runtime/darwin-os.h > +++ b/src/runtime/darwin-os.h > @@ -30,6 +30,10 @@ typedef struct ucontext os_context_t; > typedef ucontext_t os_context_t; > #endif > > +#ifdef LISP_FEATURE_MACH_EXCEPTION_HANDLER > +extern mach_port_t current_mach_task; > +#endif > + > #define SIG_MEMORY_FAULT SIGBUS > > #define SIG_STOP_FOR_GC (SIGUSR2) > diff --git a/src/runtime/thread.c b/src/runtime/thread.c > index 535263a..88048ae 100644 > --- a/src/runtime/thread.c > +++ b/src/runtime/thread.c > @@ -29,6 +29,7 @@ > #include <mach/mach.h> > #include <mach/mach_error.h> > #include <mach/mach_types.h> > +#include "darwin-os.h" > #endif > > #include "runtime.h" > @@ -318,12 +319,12 @@ new_thread_trampoline(struct thread *th) > > #ifdef LISP_FEATURE_MACH_EXCEPTION_HANDLER > FSHOW((stderr, "Deallocating mach port %x\n", THREAD_STRUCT_TO_EXCEPTION_PORT(th))); > - mach_port_move_member(mach_task_self(), > + mach_port_move_member(current_mach_task, > THREAD_STRUCT_TO_EXCEPTION_PORT(th), > MACH_PORT_NULL); > - mach_port_deallocate(mach_task_self(), > + mach_port_deallocate(current_mach_task, > THREAD_STRUCT_TO_EXCEPTION_PORT(th)); > - mach_port_destroy(mach_task_self(), > + mach_port_destroy(current_mach_task, > THREAD_STRUCT_TO_EXCEPTION_PORT(th)); > #endif > > diff --git a/src/runtime/x86-64-darwin-os.c b/src/runtime/x86-64-darwin-os.c > index 00da75f..af14c46 100644 > --- a/src/runtime/x86-64-darwin-os.c > +++ b/src/runtime/x86-64-darwin-os.c > @@ -478,7 +478,8 @@ catch_exception_raise(mach_port_t exception_port, > #ifdef LISP_FEATURE_SB_THREAD > thread_mutex_unlock(&mach_exception_lock); > #endif > - return KERN_SUCCESS; > + ret = KERN_SUCCESS; > + break; > > case EXC_BAD_INSTRUCTION: > > @@ -570,14 +571,21 @@ catch_exception_raise(mach_port_t exception_port, > #ifdef LISP_FEATURE_SB_THREAD > thread_mutex_unlock(&mach_exception_lock); > #endif > - return KERN_SUCCESS; > + ret = KERN_SUCCESS; > + break; > > default: > #ifdef LISP_FEATURE_SB_THREAD > thread_mutex_unlock(&mach_exception_lock); > #endif > - return KERN_INVALID_RIGHT; > + ret = KERN_INVALID_RIGHT; > } > + > + mach_port_deallocate (current_mach_task, exception_port); > + mach_port_deallocate (current_mach_task, thread); > + mach_port_deallocate (current_mach_task, task); > + > + return ret; > } > > void * > @@ -604,8 +612,10 @@ setup_mach_exception_handling_thread() > pthread_t mach_exception_handling_thread = NULL; > pthread_attr_t attr; > > + current_mach_task = mach_task_self (); > + > /* allocate a mach_port for this process */ > - ret = mach_port_allocate(mach_task_self(), > + ret = mach_port_allocate(current_mach_task, > MACH_PORT_RIGHT_PORT_SET, > &mach_exception_handler_port_set); > > @@ -630,11 +640,13 @@ kern_return_t > mach_thread_init(mach_port_t thread_exception_port) > { > kern_return_t ret; > + mach_port_t thread_self; > + > /* allocate a named port for the thread */ > > FSHOW((stderr, "Allocating mach port %x\n", thread_exception_port)); > > - ret = mach_port_allocate_name(mach_task_self(), > + ret = mach_port_allocate_name(current_mach_task, > MACH_PORT_RIGHT_RECEIVE, > thread_exception_port); > if (ret) { > @@ -642,7 +654,7 @@ mach_thread_init(mach_port_t thread_exception_port) > } > > /* establish the right for the thread_exception_port to send messages */ > - ret = mach_port_insert_right(mach_task_self(), > + ret = mach_port_insert_right(current_mach_task, > thread_exception_port, > thread_exception_port, > MACH_MSG_TYPE_MAKE_SEND); > @@ -650,7 +662,8 @@ mach_thread_init(mach_port_t thread_exception_port) > lose("mach_port_insert_right failed with return_code %d\n", ret); > } > > - ret = thread_set_exception_ports(mach_thread_self(), > + thread_self = mach_thread_self (); > + ret = thread_set_exception_ports(thread_self, > EXC_MASK_BAD_ACCESS | EXC_MASK_BAD_INSTRUCTION, > thread_exception_port, > EXCEPTION_DEFAULT, > @@ -658,12 +671,13 @@ mach_thread_init(mach_port_t thread_exception_port) > if (ret) { > lose("thread_set_exception_port failed with return_code %d\n", ret); > } > + mach_port_deallocate (current_mach_task, thread_self); > > - ret = mach_port_move_member(mach_task_self(), > + ret = mach_port_move_member(current_mach_task, > thread_exception_port, > mach_exception_handler_port_set); > if (ret) { > - lose("mach_port_ failed with return_code %d\n", ret); > + lose("mach_port_move_member failed with return_code %d\n", ret); > } > > return ret; > diff --git a/src/runtime/x86-darwin-os.c b/src/runtime/x86-darwin-os.c > index ad41b0f..239f7a0 100644 > --- a/src/runtime/x86-darwin-os.c > +++ b/src/runtime/x86-darwin-os.c > @@ -502,6 +502,10 @@ catch_exception_raise(mach_port_t exception_port, > siginfo.si_addr = addr; > call_handler_on_thread(thread, &thread_state, signal, &siginfo, handler); > } > + mach_port_deallocate (current_mach_task, exception_port); > + mach_port_deallocate (current_mach_task, thread); > + mach_port_deallocate (current_mach_task, task); > + > return ret; > } > > @@ -533,8 +537,10 @@ setup_mach_exception_handling_thread() > pthread_t mach_exception_handling_thread = NULL; > pthread_attr_t attr; > > + current_mach_task = mach_task_self (); > + > /* allocate a mach_port for this process */ > - ret = mach_port_allocate(mach_task_self(), > + ret = mach_port_allocate(current_mach_task, > MACH_PORT_RIGHT_PORT_SET, > &mach_exception_handler_port_set); > > @@ -559,11 +565,13 @@ kern_return_t > mach_thread_init(mach_port_t thread_exception_port) > { > kern_return_t ret; > + mach_port_t thread_self; > + > /* allocate a named port for the thread */ > > FSHOW((stderr, "Allocating mach port %x\n", thread_exception_port)); > > - ret = mach_port_allocate_name(mach_task_self(), > + ret = mach_port_allocate_name(current_mach_task, > MACH_PORT_RIGHT_RECEIVE, > thread_exception_port); > if (ret) { > @@ -571,7 +579,7 @@ mach_thread_init(mach_port_t thread_exception_port) > } > > /* establish the right for the thread_exception_port to send messages */ > - ret = mach_port_insert_right(mach_task_self(), > + ret = mach_port_insert_right(current_mach_task, > thread_exception_port, > thread_exception_port, > MACH_MSG_TYPE_MAKE_SEND); > @@ -579,7 +587,8 @@ mach_thread_init(mach_port_t thread_exception_port) > lose("mach_port_insert_right failed with return_code %d\n", ret); > } > > - ret = thread_set_exception_ports(mach_thread_self(), > + thread_self = mach_thread_self (); > + ret = thread_set_exception_ports(thread_self, > EXC_MASK_BAD_ACCESS | EXC_MASK_BAD_INSTRUCTION, > thread_exception_port, > EXCEPTION_DEFAULT, > @@ -587,8 +596,9 @@ mach_thread_init(mach_port_t thread_exception_port) > if (ret) { > lose("thread_set_exception_port failed with return_code %d\n", ret); > } > + mach_port_deallocate (current_mach_task, thread_self); > > - ret = mach_port_move_member(mach_task_self(), > + ret = mach_port_move_member(current_mach_task, > thread_exception_port, > mach_exception_handler_port_set); > if (ret) { > > Wim Oudshoorn. > > ------------------------------------------------------------------------------ > What You Don't Know About Data Connectivity CAN Hurt You > This paper provides an overview of data connectivity, details > its effect on application quality, and explores various alternative > solutions. http://p.sf.net/sfu/progress-d2d_______________________________________________ > Sbcl-devel mailing list > Sbcl-devel@... > https://lists.sourceforge.net/lists/listinfo/sbcl-devel |
From: Willem Rein Oudshoorn <woudshoo@xs...> - 2011-03-07 14:31:20
|
Just today I had some spare time and decided to look into the (with-test (:name (:two-threads-running-gc)) ... test failure on MacOSX. I see where it deadlocks. It deadlocks in the pthread library: new_sem_from_pool on the sem_pool_lock. This of course should not happen and I have a hard time pinpointing why and how this exactly happens. When do I see this ------------------ I see the deadlock in the test case above. 1. One thread is in the call gc_stop_the_world, waiting on gc_stop_the_world --> wait_for_thread_state_change --> pthread_cond_wait --> new_sem_from_pool 2. Two other threads are in sig_stop_for_gc_handler 2a. One thread at if (thread_state(thread) != STATE_RUNNING) 2b. One thread at wait_for_thread_state_change(thread, STATE_SUSPENDED); Potential cause of the deadlock ------------------------------- I am not sure, but I think the following scenario can cause the deadlock: 1. The gc_stop_the_world calls pthread_kill on another thread. This other thread holds at that moment the sem_pool_lock because it is in a pthread call. 2. the thread holding the sem_pool_lock is interrupted while still holding the lock. 3. Dead lock ensues. But I am not sure if that is what is actually happening. Wim Oudshoorn. |
From: Willem Rein Oudshoorn <woudshoo@xs...> - 2011-03-07 10:57:43
|
Wim Oudshoorn. |