While investigating 4750978 I noticed a few problems with the Solaris process
code that will occur whenever a new working directory is specified to
Runtime.exec but the directory does not exist.
- The current native code responds to this situation by throwing an exception
in the child process. This is pointless, since the exception will never be
delivered, and it risks locking up the VM.
- The child process never exits, so if this happens frequently the VM will
chew up OS resources until a fork fails with ENOMEM.
- The converted form of the directory pathname is never freed, so there's a
small memory leak.
These problems appear to have been introduced way back in 1.3.0 when the
exec-with-dir feature was first implemented.
-- ###@###.### 2002/11/25
code that will occur whenever a new working directory is specified to
Runtime.exec but the directory does not exist.
- The current native code responds to this situation by throwing an exception
in the child process. This is pointless, since the exception will never be
delivered, and it risks locking up the VM.
- The child process never exits, so if this happens frequently the VM will
chew up OS resources until a fork fails with ENOMEM.
- The converted form of the directory pathname is never freed, so there's a
small memory leak.
These problems appear to have been introduced way back in 1.3.0 when the
exec-with-dir feature was first implemented.
-- ###@###.### 2002/11/25
- duplicates
-
JDK-4790606 (process) Native forkAndExec code should be unified (sol, lnx)
- Resolved
- relates to
-
JDK-4750978 (process) Runtime.exec/Process.waitFor hang when a new directory is given (lnx)
- Resolved
-
JDK-4811767 (process) Runtime.exec should throw IOException when workdir does not exist (Unix)
- Resolved
-
JDK-4052517 (process) Runtime.exec won't execute programs belonging to other groups on Unix
- Resolved