[Mono-bugs] [Bug 537764] Mono crashes on OS X Snow Leopard

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Sep 27 05:02:21 EDT 2009


User mahegdels at telenet.be added comment

--- Comment #8 from Sledge Ham <mahegdels at telenet.be>  2009-09-27 03:02:18 MDT ---
I created the following work around:

macbook-pro-van-admin-3:~ kenny$ diff -w mono-
<     if(r != KERN_SUCCESS) {
<         mach_port_urefs_t refs=0;
<         kern_return_t r=mach_port_get_refs(mach_task_self(),
p->stop_info.mach_thread, MACH_PORT_RIGHT_DEAD_NAME, &refs);
<         if (r != KERN_SUCCESS) ABORT("Could not query thread_refs");
<         if (refs == 0) ABORT("this is not a deadname");
<         printf("We will be cleaning dead thread %p\n",
<         r = mach_port_deallocate(mach_task_self(), p->stop_info.mach_thread);
<         if (r != KERN_SUCCESS) ABORT("Could not deallocate thread");
<         p -> flags |= FINISHED;  //This might be a minor memory leak
<         continue;
<     }

Apparently snow leopard 6 creates an additional thread which is
killed/terminated in such a way that it does not execute the exit functions as
required by mono. 
This patch will mark the entry in the GC_Threads table as finished so it never
is referenced anymore.
There is a small memory leak as this entry is never cleaned from the GC_Threads
table. In the application I use there is only one instance of a lost thread so
it should be a minor issue.

Could this patch be validated on other environments?

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list