United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6428742 (process) Call CreateProcess with bInheritHandles=FALSE ?
JDK-6428742 : (process) Call CreateProcess with bInheritHandles=FALSE ?

Details
Type:
Bug
Submit Date:
2006-05-22
Status:
Resolved
Updated Date:
2013-08-08
Project Name:
JDK
Resolved Date:
2013-08-08
Component:
core-libs
OS:
generic,windows_xp
Sub-Component:
java.lang
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6,6u13
Fixed Versions:
7-pool

Related Reports
Backport:
Relates:
Relates:

Sub Tasks

Description
Currently, on Windows, Runtime.exec is implemented by calling
CreateProcess with the bInheritHandles argument set to TRUE,
which causes open handles to not be closed if they are not
explicitly set to be non-inherited.  This is the underlying cause
of many subtle bugs, such as

6347873: (so) Ports opened with ServerSocketChannel blocks when using Runtime.exec
http://monaco.sfbay/detail.jsf?cr=6347873

On Unix, we try hard to close all handles (except for standard handles, of course).
Why not also on Windows?

                                    

Comments
EVALUATION

Submitter has a point.  Very risky to fix.  
Early dolphin seems like a good time to experiment with changing this.
                                     
2006-05-22
Umbrella fix from JDK-7147084.
http://hg.openjdk.java.net/jdk8/tl/jdk/rev/2c4f1081a0fa
                                     
2013-08-08



Hardware and Software, Engineered to Work Together