RFR 9: 8133552 : java/lang/ProcessHandle/InfoTest.java fails intermittently - incorrect user

Joseph D. Darcy joe.darcy at oracle.com
Thu Sep 10 00:08:33 UTC 2015

Hi Roger,

If timeouts need to be used, I suggest rather than fixed values they be 
adjusted according to the timeout factor being used in the test run.

Can some sort of repeated testing with exponential backout to a longer 
timeout be used ? If the system is actually ready is a fraction of a 
second, it is preferable for the test to be able to complete without 
waiting the full timeout value. (Perhaps that is already encapsulated in 
the existing code.)



On 9/9/2015 2:49 PM, Roger Riggs wrote:
> Hi,
> Please review this update to extract the uid on from the owner of the 
> /proc/<pid> file.
> It should be more reliable than using the owner of the 
> /proc/<pid>/cmdline file.
> Webrev:
>     http://cr.openjdk.java.net/~rriggs/webrev-info-8133552/
> Thanks, Roger
> On 9/9/2015 12:56 PM, Roger Riggs wrote:
>> Hi Volker,
>> Thanks for the review and diagnosis.
>> Can opening /proc/pid be used as a fallback if the st_uid is zero or
>> is it worth the overhead of stat'ing /proc/pid always?
>> Thanks, Roger
>> On 9/9/2015 11:46 AM, Volker Simonis wrote:
>>> Hi Roger,
>>> I think your change looks good and it surely improves the test
>>> stability but I don't think it solves the problem in all cases.
>>> I think this problem is caused by a <defunct> (i.e. "zombie") process
>>> (the spawned process lived too short and was already a zombie when the
>>> info object was created). If you look at the proc-file system entry of
>>> a <defunct> process you can see that its 'cmdline' file has zero size
>>> and the file is owned by root. This is exactly what is reported by the
>>> corresponding info object in the bug report (user=root and no cmd
>>> field).
>>> We may need to improve the way how we get the uid of a pid on Linux.
>>> The current way of querying the owner of /proc/<pid>/cmdline seems to
>>> be unreliable. We may instead take the owner of /proc/<pid> which
>>> seems to be still the initial user of the process.
>>> Regards,
>>> Volker
>>> On Tue, Sep 8, 2015 at 11:35 PM, Roger Riggs 
>>> <Roger.Riggs at oracle.com> wrote:
>>>> With link to webrev corrected:
>>>> On 9/8/2015 5:08 PM, Roger Riggs wrote:
>>>>> Please review an intermittent test bug fix.
>>>>> The test setup time is very short and the user may be returned as 
>>>>> 0 which
>>>>> is reported as root.
>>>>> The correction lengthens the time allowed for the process to start.
>>>>> The test is removed from the ProblemList.
>>>>> Webrev:
>>>>> http://cr.openjdk.java.net/~rriggs//webrev-info-8133552
>>>>> Bug:
>>>>>    https://bugs.openjdk.java.net/browse/JDK-8133552
>>>>> Thanks, Roger

More information about the core-libs-dev mailing list