RFR: JDK-8204994: SA might fail to attach to process with "Windbg Error: WaitForEvent failed"
Alex Menkov
alexey.menkov at oracle.com
Fri May 29 00:04:51 UTC 2020
Hi Serguei,
With my testing 2nd call always succeeded, but I was able to reproduce
the case only 3 times with my test runs.
I can implement the loop, but number of retries is anyway an arbitrary
value.
--alex
On 05/28/2020 15:44, serguei.spitsyn at oracle.com wrote:
> Hi Alex,
>
> It looks good in general.
>
> +static HRESULT WaitForEvent(IDebugControl *ptrIDebugControl) {
> + // see JDK-8204994: sometimes WaitForEvent fails with E_ACCESSDENIED,
> + // but succeeded on 2nd call.
> + HRESULT hr = ptrIDebugControl->WaitForEvent(DEBUG_WAIT_DEFAULT, INFINITE);
> + if (hr == E_ACCESSDENIED) {
> + // yield current thread use of a processor (short delay).
> + SwitchToThread();
> + hr = ptrIDebugControl->WaitForEvent(DEBUG_WAIT_DEFAULT, INFINITE);
> + }
> + return hr;
> +}
>
>
> Can the ptrIDebugControl->WaitForEvent fail with E_ACCESSDENIED twice
> and succeed on third call?
> Would it better to make it a loop with more retry attempts?
>
> Thanks,
> Serguei
>
>
> On 5/27/20 13:54, Alex Menkov wrote:
>> Hi all,
>>
>> please review the fix for
>> https://bugs.openjdk.java.net/browse/JDK-8204994
>> webrev:
>> http://cr.openjdk.java.net/~amenkov/jdk15/WinDbg_WaitForEvent/webrev/
>>
>> --alex
>
More information about the serviceability-dev
mailing list