Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4842507

(process) Runtime.exec with bogus working dir arg hangs child process (sol)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.3.0, 1.4.2
    • core-libs
    • None
    • sparc
    • solaris_7, solaris_8

      Runtime.exec with a third argument (current working directory argument) that
      refers to a nonexistant directory can cause the child process to hang. This
      is on Solaris 8 w/ 1.4.2-b18.

      The following testcase will hang waiting for the hung child process:

      import java.io.*;

      public class FAEBug {
      public static void main(String args[]) {
      try {
      Process p = Runtime.getRuntime().exec("/usr/bin/ls",
      null,
      new File("foo"));
      p.waitFor();
      } catch (Exception e) {
      e.printStackTrace();
      }
      }
      }

      See also comments.

            iris Iris Clark
            sbohne Steve Bohne (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: