JDK-4842507 : (process) Runtime.exec with bogus working dir arg hangs child process (sol)
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.3.0,1.4.2
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_7,solaris_8
  • CPU: sparc
  • Submitted: 2003-04-03
  • Updated: 2003-04-04
  • Resolved: 2003-04-04
Related Reports
Duplicate :  
Relates :  
Description
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.

Comments
EVALUATION please see SunOne bug that was originally filed from...4823901 ###@###.### 2003-04-04 This behaviour has existed since the API was introduced in jdk1.3. Duplicate of bug 4811767 -- iag@sfbay 2003-04-04
04-04-2003