[Gc] Re: Win32 hang with MPROTECT_VDB

Ivan Maidanski ivmai at mail.ru
Thu May 21 07:06:56 PDT 2009


Hi!

"Boehm, Hans" <hans.boehm at hp.com> wrote:
> I think the offending scenario is as follows:
> 
> - thread A takes a protection fault, and is somewhere inside ntdll, holding a system lock.
> - thread B starts a GC, suspending A.
> - thread B reprotects the heap.
> - thread B subsequently tries to restart the world, in the process, setting t -> suspended to FALSE, for some t.

I also observed fault at "thread -> last_stack_min = stack_min;"

> - the access to t faults; B tries to invoke the protection handler.
> - A hasn't yet been restarted; hence it still holds the system lock.

B tries to invoke the protection handler... and what?
At which point are A and B exactly?

Q: Is this possible in Unix too?
        /* Currently we do this by disabling the thread stopping        */
        /* signals while this handler is running.  An alternative might */

> 
> oops.
> 
> We probably need to be more careful about causing protection faults with the world stopped.  I'm not sure if there is a way to avoid suspending a thread while it's in the fault handler.

Is this means there must be no op writing outside local stack while at least one thread is stopped?

> 
> This was A LOT easier to debug once I figured out how to get ntdll symbols ...
Thanks.

> 
> Hans
>  

Bye.


More information about the Gc mailing list