RFR 8160892: VM warning: WaitForMultipleObjects timed out
David Holmes
david.holmes at oracle.com
Tue Jul 12 04:01:48 UTC 2016
Hi Ivan,
On 7/07/2016 2:55 AM, Ivan Gerasimov wrote:
> Hello!
>
> When fixing JDK-8069048 a potential race was overlooked:
> 1) Thread A wants to call _endthreadex() and registers itself,
> 2) Thread B wants to call exit(), takes its turn and raises the flag
> `process_exiting`,
> 3) Thread A continues, and gets captured in the loop at 4020, in
> SuspendThread(GetCurrentThread()),
> 4) Now, the thread B will have to wait for all the registered threads,
> including the thread A, which will never wake up.
>
> Would you please help review the fix?
>
> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8160892
> WEBREV: http://cr.openjdk.java.net/~igerasim/8160892/00/webrev/
Nit: can we change 'registered_itself" to just "registered" please.
Can you explain under what conditions a thread will now reach the
self-suspension code. Is that only if an error occurred such that we
were unable to register our handle for the process-exiting thread to
wait on? If so some commentary on that block seems appropriate - perhaps
more appropriate there than back up at the place where it failed to get
the handle (as Dan requested).
Given we keep missing conditions I'm only cautiously optimistic about
this. And I'd like to understand how we still sometimes end up exiting
with an "error code" that seems to be the value of an exception! :(
Thanks,
David
> With kind regards,
> Ivan
>
More information about the hotspot-dev
mailing list