public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/11801] New: Problems with Process.waitFor() and exitValue()
@ 2003-08-05  5:04 bryce at mckinlay dot net dot nz
  2003-08-05  5:21 ` [Bug libgcj/11801] " pinskia at physics dot uc dot edu
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: bryce at mckinlay dot net dot nz @ 2003-08-05  5:04 UTC (permalink / raw)
  To: gcc-bugs

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?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/11801] Problems with Process.waitFor() and exitValue()
  2003-08-05  5:04 [Bug libgcj/11801] New: Problems with Process.waitFor() and exitValue() bryce at mckinlay dot net dot nz
@ 2003-08-05  5:21 ` pinskia at physics dot uc dot edu
  2003-08-05  5:51 ` bryce at mckinlay dot net dot nz
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-08-05  5:21 UTC (permalink / raw)
  To: gcc-bugs

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-05 05:21:48
               date|                            |


------- Additional Comments From pinskia at physics dot uc dot edu  2003-08-05 05:21 -------
I can confirm Problem 1.

Problem 2 sounds more like a Linux (Linux Threads or otherwise, glibc) problem rather than a 
libgcj problem as it will work fine on Darwin as threads are not processes in Darwin.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/11801] Problems with Process.waitFor() and exitValue()
  2003-08-05  5:04 [Bug libgcj/11801] New: Problems with Process.waitFor() and exitValue() bryce at mckinlay dot net dot nz
  2003-08-05  5:21 ` [Bug libgcj/11801] " pinskia at physics dot uc dot edu
@ 2003-08-05  5:51 ` bryce at mckinlay dot net dot nz
  2003-08-23  1:09 ` dhazeghi at yahoo dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: bryce at mckinlay dot net dot nz @ 2003-08-05  5:51 UTC (permalink / raw)
  To: gcc-bugs

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



------- Additional Comments From bryce at mckinlay dot net dot nz  2003-08-05 05:51 -------
Yes, it is presumably due to linux's 1:1 thread->pid mapping. I guess that POSIX does not specify 
how waitpid() should interact with threads, in which case it isn't a bug in linuxthreads. In any case, 
the JRE works correctly on the same system, so its something that needs to be fixed in libgcj.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/11801] Problems with Process.waitFor() and exitValue()
  2003-08-05  5:04 [Bug libgcj/11801] New: Problems with Process.waitFor() and exitValue() bryce at mckinlay dot net dot nz
  2003-08-05  5:21 ` [Bug libgcj/11801] " pinskia at physics dot uc dot edu
  2003-08-05  5:51 ` bryce at mckinlay dot net dot nz
@ 2003-08-23  1:09 ` dhazeghi at yahoo dot com
  2003-09-28 20:39 ` tromey at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-08-23  1:09 UTC (permalink / raw)
  To: gcc-bugs

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


dhazeghi at yahoo dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4                         |---


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/11801] Problems with Process.waitFor() and exitValue()
  2003-08-05  5:04 [Bug libgcj/11801] New: Problems with Process.waitFor() and exitValue() bryce at mckinlay dot net dot nz
                   ` (2 preceding siblings ...)
  2003-08-23  1:09 ` dhazeghi at yahoo dot com
@ 2003-09-28 20:39 ` tromey at gcc dot gnu dot org
  2003-11-08  1:29 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tromey at gcc dot gnu dot org @ 2003-09-28 20:39 UTC (permalink / raw)
  To: gcc-bugs

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



------- Additional Comments From tromey at gcc dot gnu dot org  2003-09-28 19:10 -------
I recently discovered that if your program does not call
waitFor() on a process, it will remain as a zombie.
This is predictable, of course, since only waitFor() calls wait
to reap the child.  However, this is a difference from the
JDK, and thus arguably a bug.

I'm not too concerned about LinuxThreads problems; the world
is moving to NPTL...


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/11801] Problems with Process.waitFor() and exitValue()
  2003-08-05  5:04 [Bug libgcj/11801] New: Problems with Process.waitFor() and exitValue() bryce at mckinlay dot net dot nz
                   ` (3 preceding siblings ...)
  2003-09-28 20:39 ` tromey at gcc dot gnu dot org
@ 2003-11-08  1:29 ` pinskia at gcc dot gnu dot org
  2003-11-08  1:38 ` daney at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-08  1:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-08 01:29 -------
*** Bug 12956 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daney at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11801


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/11801] Problems with Process.waitFor() and exitValue()
  2003-08-05  5:04 [Bug libgcj/11801] New: Problems with Process.waitFor() and exitValue() bryce at mckinlay dot net dot nz
                   ` (4 preceding siblings ...)
  2003-11-08  1:29 ` pinskia at gcc dot gnu dot org
@ 2003-11-08  1:38 ` daney at gcc dot gnu dot org
  2003-11-08  1:45 ` bryce at mckinlay dot net dot nz
  2004-03-24  6:39 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: daney at gcc dot gnu dot org @ 2003-11-08  1:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From daney at gcc dot gnu dot org  2003-11-08 01:38 -------
The way to solve the problem on non-NPTL linux systems is to create a thread
that is dedicated to forking and waiting for all execed processes.  This is the
approach that Sun's runtime uses.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2003-08-05 05:21:48         |2003-11-08 01:38:31
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11801


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/11801] Problems with Process.waitFor() and exitValue()
  2003-08-05  5:04 [Bug libgcj/11801] New: Problems with Process.waitFor() and exitValue() bryce at mckinlay dot net dot nz
                   ` (5 preceding siblings ...)
  2003-11-08  1:38 ` daney at gcc dot gnu dot org
@ 2003-11-08  1:45 ` bryce at mckinlay dot net dot nz
  2004-03-24  6:39 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: bryce at mckinlay dot net dot nz @ 2003-11-08  1:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bryce at mckinlay dot net dot nz  2003-11-08 01:45 -------
That sounds like the right approach. We could possibly simplify a lot of a lot of natPosixProcess.cc 
by doing this.

A related bug I noticed recently is that Process.destroy() leaves a zombie, because it also doesnt 
call waitpid().


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11801


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcj/11801] Problems with Process.waitFor() and exitValue()
  2003-08-05  5:04 [Bug libgcj/11801] New: Problems with Process.waitFor() and exitValue() bryce at mckinlay dot net dot nz
                   ` (6 preceding siblings ...)
  2003-11-08  1:45 ` bryce at mckinlay dot net dot nz
@ 2004-03-24  6:39 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-24  6:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-24 06:39 -------
*** Bug 14709 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |debian-gcc at lists dot
                   |                            |debian dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11801


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-03-24  6:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-05  5:04 [Bug libgcj/11801] New: Problems with Process.waitFor() and exitValue() bryce at mckinlay dot net dot nz
2003-08-05  5:21 ` [Bug libgcj/11801] " pinskia at physics dot uc dot edu
2003-08-05  5:51 ` bryce at mckinlay dot net dot nz
2003-08-23  1:09 ` dhazeghi at yahoo dot com
2003-09-28 20:39 ` tromey at gcc dot gnu dot org
2003-11-08  1:29 ` pinskia at gcc dot gnu dot org
2003-11-08  1:38 ` daney at gcc dot gnu dot org
2003-11-08  1:45 ` bryce at mckinlay dot net dot nz
2004-03-24  6:39 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).