This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug libgcj/30937] New: Win32: Process.exitValue() does not work after multiple calls to a terminated process
- From: "r_ovidius at eml dot cc" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 23 Feb 2007 19:37:18 -0000
- Subject: [Bug libgcj/30937] New: Win32: Process.exitValue() does not work after multiple calls to a terminated process
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
After calling process.waitFor(), or calling process.exitValue() multiple times
on a process that has exited, the process returns
"java.lang.IllegalThreadStateException: Process has not exited" even though it
has. Sun's java, and gcj on linux does not have this problem.
Result on SUN win32:
5
EV: 5 java.lang.ProcessImpl@13e8d89
EV: 5 java.lang.ProcessImpl@13e8d89
Result on GCJ 4.2 Win: (probably 4.3 as well since it doesn't look changed in
viewcvs):
5
X: java.lang.IllegalThreadStateException: Process has not exited
X: java.lang.IllegalThreadStateException: Process has not exited
Snippet:
import java.io.FileOutputStream;
import java.io.PrintStream;
public class ProcTest {
static Process process;
public static void main(String[] args) {
try {
String bat = "exitcode.bat";
PrintStream p = new PrintStream(new FileOutputStream(bat));
p.println("@exit 5");
p.close();
process = Runtime.getRuntime().exec(bat);
try {
int wf = process.waitFor();
System.err.println(wf);
} catch (InterruptedException e) {
}
try {
int ev = process.exitValue();
System.err.println("EV: " + ev + " " + process);
} catch (IllegalThreadStateException ile) {
System.err.println("X: " + ile);
}
try {
int ev = process.exitValue();
System.err.println("EV: " + ev + " " + process);
} catch (IllegalThreadStateException ile) {
System.err.println("X: " + ile);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
--
Summary: Win32: Process.exitValue() does not work after multiple
calls to a terminated process
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: r_ovidius at eml dot cc
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30937