JDK-8062070 : com/sun/jdi/DoubleAgentTest.java.DoubleAgentTest fails intermittently after 8056143
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-10-24
  • Updated: 2016-03-18
  • Resolved: 2014-10-27
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 9
9 b38Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
The test fails to parse stdout and stderr from the target application and one can see the following exceptions being reported:

java.io.IOException: Stream closed
	at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:170)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:336)
	at java.io.FilterInputStream.read(FilterInputStream.java:107)
	at jdk.testlibrary.StreamPumper.run(StreamPumper.java:114)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at jdk.testlibrary.StreamPumper$1.run(StreamPumper.java:193)
	at java.lang.Thread.run(Thread.java:745)
Comments
It turns out that Process.get*Stream() methods will get confused when calling Process.destroy/Forcibly/() on an already exited process - the streams will get closed and any attempt to read or write to them will end with a SocketException. The failure is timing related - when the stream manages to buffer data before destroying the process from another thread the test passes. Otherwise it just fails. The solution is to forcibly close an external process (started by ProcessTools.executeProcess()) only in cases when eg. Process.waitFor() throws an exception.
24-10-2014