[Mono-dev] thread race during code generation

David Miller davem at davemloft.net
Mon Nov 12 03:57:36 EST 2007

From: David Miller <davem at davemloft.net>
Date: Sun, 04 Nov 2007 01:34:28 -0700 (PDT)

> With this information, I hope it should be pretty easy for someone
> to fix this bug. :-)

Can someone please look at this?

This triggers every time I run the nunit testsuite on basically every
platform I've tried it on (x86, sparc, and ppc so far).  As a result I
have to manually watch over the testsuite runs and kill off the stuck
mono thread when this race condition triggers or else the "make check"
wedges forever.

The only solutions I see to this problem are:

1) Check for pending exceptions and events such as a thread
   state change right before every time we jump into managed

   This unfortunately, is also racey, the signal can arrive
   right after we retest and before we jump into the managed

2) Mask out the thread event signal, and somehow atomically
   unmask that signal and branch to the managed code.  Perhaps
   using a setcontext() call from a trampoline of some sort.

Or, we could simply allow thread abort events to be processed
even if they arrive while compiling, if that can be managed
properly wrt. dropping domain locks and things of that


More information about the Mono-devel-list mailing list