This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgcj/11801] New: Problems with Process.waitFor() and exitValue()
- From: "bryce at mckinlay dot net dot nz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Aug 2003 05:04:26 -0000
- Subject: [Bug libgcj/11801] New: Problems with Process.waitFor() and exitValue()
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11801
Summary: Problems with Process.waitFor() and exitValue()
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bryce at mckinlay dot net dot nz
CC: gcc-bugs at gcc dot gnu dot org
There are some bugs with libgcj's POSIX Runtime.exec implementation.
Problem #1: Process.exitValue() only returns the processes exit code if waitFor() has already been
called, because only waitFor() ever calls waitpid.
Problem #2: Process.waitFor() and Process.exitValue() do not work if they are called from a thread
other than the thread which called Runtime.exec(). This seems to be because the pid created in
Runtime.exec() is only considered a child of the thread which created it.
Currently the problem can be hidden in some cases because Process.waitFor() will actually return 0
if waitpid returns an error other than EINTR.
Possible solution: SIGCHLD handler?