[Bug java/33218] New: Process.waiFor() Process.destroy() misbehave for childs which are not reacting to Ctrl+C SIGQUIT

cyberflex at mail dot ru gcc-bugzilla@gcc.gnu.org
Tue Aug 28 14:56:00 GMT 2007


When creating process (Process p = ...) which do not respond to Ctrl+C
then behavior of destroy or waitFor or both is incorrect.

Process blocking/discarding signal sent by Ctrl+C is not killed by destroy().
(The Process.destroy() supposed (IMHO) to kill the child process forcibly.)

After calling destroy() other method waitFor() returns immediately instead of
waiting (survived after the signal) process completion forever.

Such behavior looks to be such  a discrepancy.


Test case:
I encounted the problem when used following command line
rfcomm listen -i hci0 /dev/rfcomm0 6

rfcomm doesn't react to Ctrl+C till external connection is accepted.

Program code:

Process p =    <rfcomm ...>
p.destroy();
p.waitFor()
System.out.println("waitFor completed");





ps ax | grep rfcomm


Workaround for application:
kill such processes explicitly with "kill -9" or
kill subchildren of shell scripts by themselves using shell "trap" command.


Not sure that the issue exists in 4.2.x, I haven't one to test with
architectures I use.


-- 
           Summary: Process.waiFor() Process.destroy() misbehave for childs
                    which are not reacting to Ctrl+C SIGQUIT
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cyberflex at mail dot ru
  GCC host triplet: arm_le, x86 - native compilation


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



More information about the Java-prs mailing list