JDK-6428742 : (process) Call CreateProcess with bInheritHandles=FALSE ?
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 6,6u13
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,windows_xp
  • CPU: generic
  • Submitted: 2006-05-22
  • Updated: 2013-08-08
  • Resolved: 2013-08-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7-poolFixed
Related Reports
Relates :  
Relates :  
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
Umbrella fix from JDK-7147084. http://hg.openjdk.java.net/jdk8/tl/jdk/rev/2c4f1081a0fa
08-08-2013

EVALUATION Submitter has a point. Very risky to fix. Early dolphin seems like a good time to experiment with changing this.
22-05-2006