[ping] Re: RFR 8144308: com/sun/jdi/SuspendThreadTest.java failed with "transport error 202: send failed: Broken pipe"

serguei.spitsyn at oracle.com serguei.spitsyn at oracle.com
Tue Dec 8 10:33:03 UTC 2015


On 12/8/15 02:16, Jaroslav Bachorik wrote:
> On 8.12.2015 04:38, David Holmes wrote:
>> On 8/12/2015 6:54 AM, serguei.spitsyn at oracle.com wrote:
>>> Hi Jaroslav,
>>>
>>> Looks good.
>>> Would it more clean with the "volatile" keyword ?
>>>
>>> 45 public static boolean active = true;
>>
>> If set and read in different threads then it must be volatile. Else C2
>> can turn it into an if-check outside an infinite loop.
>
> The code is run under debugger only. The method also contains a 
> breakpoint. My guess would be C2 would not do any optimization here - 
> is my assumption correct?
I agree.
The code of SuspendThreadTarg.main() will be executed in the interpreter.
However, adding the "volatile" keyword does not harm.
Moreover, it would self-explain the role of the "active" field.

Thanks,
Serguei

>
> -JB-
>
>>
>> David
>>
>>> Thanks,
>>> Serguei
>>>
>>>
>>> On 12/7/15 00:43, Jaroslav Bachorik wrote:
>>>> On 1.12.2015 18:33, Jaroslav Bachorik wrote:
>>>>> Please, review the following simple test change
>>>>>
>>>>> Issue : https://bugs.openjdk.java.net/browse/JDK-8144308
>>>>> Webrev: http://cr.openjdk.java.net/~jbachorik/8144308/webrev.00
>>>>>
>>>>> The test keeps the debuggee spinning in a loop and does not stop it
>>>>> once
>>>>> the testing is over. While the harness usually takes care of this,
>>>>> occasionally it fails while trying to do that.
>>>>>
>>>>> The fix is to add a loop invariant variable and set it to false 
>>>>> once we
>>>>> are done with the debugee and it is ok for it to finish.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> -JB-
>>>>
>>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20151208/bd95c1a1/attachment.html>


More information about the serviceability-dev mailing list