Review request: JDK-7147084 (process) appA hangs when read output stream of appB which starts appC that runs forever (v.1)

Alexey Utkin alexey.utkin at
Thu May 16 10:11:36 UTC 2013

Bug description:

Here is the suggested fix:

Summary for  v1 changes:

-- The set of handles that need to restore the inherit flag was extended 
by child process IOE handles. That was done to avoid "greedy sibling" 
problem for the file handles. The file handles are closed outside the 
synchronized block.
-- "Greedy sibling" problem is covered by the 
[test/java/lang/ProcessBuilder/] test.
-- The fact that the set of current process standard IOE handles and the 
set of child process IOE handles can intersect was taken into account.
-- The [test/java/lang/ProcessBuilder/] was changed 
in accordance with Martin's concern.

Bugs 7147084 and 6921885 have visible impact for IDE's functionality. If 
they have a "hint" for the problem, the "hint" may produce the "regression".


On 5/13/2013 6:44 PM, Alexey Utkin wrote:
> Thanks, Martin!
> You are right. The approach
>     private static String JAVA_EXE = System.getProperty("java.home")
>         + File.separator + "bin"
>         + File.separator + "java";
>     private static String[] getCommandArray(String processName) {
>         String[] cmdArray = {
>             JAVA_EXE,
>             "-cp",
>             System.getProperty("java.class.path"),
>             InheritIOEHandle.class.getName(),
>             processName
>         };
>         return cmdArray;
>     }
> is better. There is one more problem with raise-condition for the file 
> handles. In current edition there is delta when the file handle could 
> be inherited by the concurrent process. That is not fatal for 
> read/write, but not good for delete. Synchronized call does not cover 
> the file.close in finalized block.
> I will prepare new edition soon.
> Regards,
> -uta
> On 5/8/2013 10:20 PM, Martin Buchholz wrote:
>> Alexey,
>> Thanks for working on the scary windows process stuff.
>> I only have time for superficial review.
>> It looks like you know what you're doing.
>> +        String[] cmdArray = {
>> +            "java",
>> +            "-cp",
>> This looks like it's invoking whatever "java" is on the path. But 
>> there's no guarantee there is such a java, or that it's the right 
>> one.  Consider invoking the java we're in, as in other jtreg tests 
>> like IIRC ProcessBuilder/

More information about the core-libs-dev mailing list