EVALUATION
An excellent find by the submitter.
Introduced in b81 by the fixes for
4052517: (process) Runtime.exec won't execute programs belonging to other groups on Unix
4811767: (process) Runtime.exec should throw IOException when workdir does not exist (Unix)
5033302: (process) Can't execute Solaris NFS programs with uid>64k on Linux-amd64
The following looks like the fix:
--- /tmp/geta13483 2006-09-22 04:00:00.418839800 -0700
+++ UNIXProcess_md.c 2006-09-22 03:55:15.499011000 -0700
@@ -571,14 +571,15 @@
_exit(-1);
}
/* parent process */
close(fail[1]); fail[1] = -1; /* See: WhyCantJohnnyExec */
if (read(fail[0], &errnum, sizeof(errnum)) != 0) {
+ waitpid(resultPid, NULL, 0);
throwIOException(env, errnum, "Exec failed");
goto Catch;
}
(*env)->SetIntField(env, stdin_fd, IO_fd_fdID, in [1]);
(*env)->SetIntField(env, stdout_fd, IO_fd_fdID, out[0]);
(*env)->SetIntField(env, stderr_fd, IO_fd_fdID, err[0]);
|