-
Bug
-
Resolution: Fixed
-
P3
-
6u12, 7
-
b130
-
generic
-
generic
-
Verified
The test
java/lang/Runtime/exec/Duped.java
fails if the child process performs this check on line 43:
(System.in.available() != 0)
earlier than the parent process has a chance to write to the output stream (line 79).
The failure is fairly easy to reproduce by compiling the test standalone and running it in -Xcomp mode. As the child is started in default -Xmixed mode, it runs "faster" than the parent, and the test fails in roughly one case out of 3:
$ javac Duped.java
$ java -Xcomp Duped
Exception in thread "main" java.lang.Exception: Failed, read ``''
at Duped.main(Duped.java:87)
As we dont mind if the child blocks on the read call when there is no data available yet and this is even desirable, I think that the check on line 43 (System.in.available() != 0) is superfluos. Removing it fixes the issue.
java/lang/Runtime/exec/Duped.java
fails if the child process performs this check on line 43:
(System.in.available() != 0)
earlier than the parent process has a chance to write to the output stream (line 79).
The failure is fairly easy to reproduce by compiling the test standalone and running it in -Xcomp mode. As the child is started in default -Xmixed mode, it runs "faster" than the parent, and the test fails in roughly one case out of 3:
$ javac Duped.java
$ java -Xcomp Duped
Exception in thread "main" java.lang.Exception: Failed, read ``''
at Duped.main(Duped.java:87)
As we dont mind if the child blocks on the read call when there is no data available yet and this is even desirable, I think that the check on line 43 (System.in.available() != 0) is superfluos. Removing it fixes the issue.