RFR: 8046883 com/sun/jdi/ProcessAttachTest.sh gets "java.io.IOException: Invalid process identifier" on windows
Staffan Larsen
staffan.larsen at oracle.com
Tue Jun 17 12:35:18 UTC 2014
On 17 jun 2014, at 11:45, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> On 17/06/2014 09:24, Staffan Larsen wrote:
>> This is yet another fallout of the bug in the ps command in cygwin that causes it to sometimes miss process in the list.
>>
>> In this case I cannot use jps to list the processes since one of the test cases launches jdwp with suspend=y which suspends the VM before it is visible to jps. Instead I retry the ps command 10 times hoping that it works eventually.
>>
>> webrev: http://cr.openjdk.java.net/~sla/8046883/webrev.00/test/com/sun/jdi/ProcessAttachTest.sh.sdiff.html
>> bug: https://bugs.openjdk.java.net/browse/JDK-8046883
>>
> I don't understand the bug in cygwin but I just wonder if it's a timing issue. If it is then maybe it would be better to sleep 2 at line 79 into the loop as a sleep 1?
It could be a timing issue, but in the other direction. If cygwin hasn’t yet started the real windows process when I run ps, then maybe ps will not list it. But given the “sleep 2” before the ps invocation, the process should have had time to started. No guarantees of course.
Making the sleep shorter will not help as the process we are starting will not terminate until we tell it to.
/Staffan
>
> -Alan.
More information about the serviceability-dev
mailing list