java.lang.IllegalThreadStateException: process has not exited

JDK Bug System | Webbug Group | 3 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 1

    FULL PRODUCT VERSION : java version "1.8.0_05" Java(TM) SE Runtime Environment (build 1.8.0_05-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode) ADDITIONAL OS VERSION INFORMATION : Windows All JDK 7 and JDK 8 A DESCRIPTION OF THE PROBLEM : Use Runtime.getTime() to create a subprocess and the exit value of the subprocess is 0x103(259) will cause an IllegalThreadStateException. ADDITIONAL REGRESSION INFORMATION: java version "1.8.0_05" Java(TM) SE Runtime Environment (build 1.8.0_05-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode) EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - no result ACTUAL - Exception in thread "main" java.lang.IllegalThreadStateException: process has not exited at java.lang.ProcessImpl.exitValue(ProcessImpl.java:442) at java.lang.ProcessImpl.waitFor(ProcessImpl.java:451) at com.ys168.zhanhb.commons.io.TestExit0x103.main(Exit0x103.java:21) Java Result: 1 ERROR MESSAGES/STACK TRACES THAT OCCUR : no message REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- package com.ys168.zhanhb.commons.io; import java.io.IOException; public class Exit0x103 { public static void main(String[] args) { System.exit(0x103); } } class TestExit0x103 { public static void main(String[] args) throws IOException, InterruptedException { Runtime.getRuntime().exec(new String[]{ System.getProperty("java.home") + "/bin/java", "-cp", System.getProperty("java.class.path"), Exit0x103.class.getName() }).waitFor(); } } ---------- END SOURCE ----------

    JDK Bug System | 3 years ago | Webbug Group
    java.lang.IllegalThreadStateException: process has not exited

    Root Cause Analysis

    1. java.lang.IllegalThreadStateException

      process has not exited

      at java.lang.ProcessImpl.exitValue()
    2. Java RT
      ProcessImpl.waitFor
      1. java.lang.ProcessImpl.exitValue(ProcessImpl.java:442)
      2. java.lang.ProcessImpl.waitFor(ProcessImpl.java:451)
      2 frames
    3. com.ys168.zhanhb
      TestExit0x103.main
      1. com.ys168.zhanhb.commons.io.TestExit0x103.main(Exit0x103.java:21)
      1 frame