This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: waitpid in natPosixProcess.cc


Casey Marshall writes:

 > Attached is a simple patch that invokes waitpid if either the process
 > is destroy()ed or the C call to exec() fails.
 > 
 > This prevents Runtime.exec from spawning zombie processes if the given
 > command cannot be found, or if the process is killed. I wasn't sure if
 > it was appropriate to call waitFor instead, but (AFAIK) calling
 > waitpid in these two spots is safe.

I think this is probably wrong, because you don't set hasExited in the
Process.  With this patch, a subsequent call to Process::destroy will
cause some other process that coincidentally has the same PID to be
killed.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]