Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4399763

Linux: Method Process.destroy() does not really kill the subprocess

XMLWordPrintable

    • beta
    • x86
    • linux
    • Verified



      Name: egR10015 Date: 12/20/2000



      Method Process.destroy() from HotSpot 1.4.0beta-b45 does not really kill
      the subprocess on Linux.
      The test (see test.java from GammaBase) starts to execute the class flhndlr008
      in a separate process. After some time it invokes the method Process.destroy()
      which should kill the subprocess. Finally, the test tries to get the exit value
      for the subprocess by calling method Process.exitValue() in infinite loop
      until the subprocess has been really terminated, i.e.
      IllegalThreadStateException
      has not been thrown.
      But actually the Process.destroy() does not kill the subprocess. Therefore
      the test infinitely catches the IllegalThreadStateException and never ends.
      Moreover, after interrupt main java's process, several java's subprocesses
      (not threads) generated by the killed main process, are left in operating
      system.
      Those subprocesses may be killed only by sending the KILL signal.

      Note that on other platforms (Solaris, win32) the test and the generated
      subprocess
      successfully terminate.

      To reproduce the bug run
      doit.ksh <jdk root directory> on Linux
      in
      /net/sqesvr/export/vsn/GammaBase/Bugs/<this bug number>

      -------- output on Linux with with HS 1.4.0beta-b45 --------
      eug@linux-3N191 ./doit.ksh /export/ld24/java/hotspot/jdk1.4/linux
      Note: flhndlr008.java uses or overrides a deprecated API.
      Note: Recompile with -deprecation for details.
      java version "1.4.0beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0beta-b45)
      Java HotSpot(TM) Client VM (build 1.4beta-B45, mixed mode)
      EXITVALUE ERROR: process hasn't exited
      EXITVALUE ERROR: process hasn't exited
      EXITVALUE ERROR: process hasn't exited
      EXITVALUE ERROR: process hasn't exited
      EXITVALUE ERROR: process hasn't exited
      <the test is looping>
      ^C
      eug@linux-3N192 ps -fu eug |grep java
      eug 17680 1 0 14:47 pts/0 00:00:00 /export/ld59/java/dest/jdk1.4.0b
      eug 17720 17680 0 14:47 pts/0 00:00:00 /export/ld59/java/dest/jdk1.4.0b
      eug 17721 17720 0 14:47 pts/0 00:00:00 /export/ld59/java/dest/jdk1.4.0b
      eug 17722 17720 0 14:47 pts/0 00:00:00 /export/ld59/java/dest/jdk1.4.0b
      eug 17723 17720 0 14:47 pts/0 00:00:00 /export/ld59/java/dest/jdk1.4.0b
      eug 17724 17720 0 14:47 pts/0 00:00:00 /export/ld59/java/dest/jdk1.4.0b
      eug 17725 17720 0 14:47 pts/0 00:00:00 /export/ld59/java/dest/jdk1.4.0b
      eug 17726 17720 0 14:47 pts/0 00:00:00 /export/ld59/java/dest/jdk1.4.0b
      eug 17727 17720 0 14:47 pts/0 00:00:00 /export/ld59/java/dest/jdk1.4.0b
      eug 17728 17720 0 14:47 pts/0 00:00:00 /export/ld59/java/dest/jdk1.4.0b
      eug 17729 17720 0 14:47 pts/0 00:00:00 /export/ld59/java/dest/jdk1.4.0b
      eug 17730 17720 0 14:47 pts/0 00:00:00 /export/ld59/java/dest/jdk1.4.0b
      eug 17731 17720 0 14:47 pts/0 00:00:00 /export/ld59/java/dest/jdk1.4.0b
      eug 17744 1882 0 14:50 pts/1 00:00:00 grep -n java
      ------------------------------------------------------------

      ------ output on Solaris/Sparc with HS 1.4.0beta-b45 ------
      $ ./doit.sh /export/ld24/java/hotspot/jdk1.4/solsparc
      Note: flhndlr008.java uses or overrides a deprecated API.
      Note: Recompile with -deprecation for details.
      java version "1.4.0beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0beta-b45)
      Java HotSpot(TM) Client VM (build 1.4beta-B45, mixed mode)
      Exit code of external process: 95
      <the test exits>
      $ ps -fu eug |grep java
      eug 2550 2542 0 20:54:19 pts/4 0:00 grep -n java
      eug 2542 436 1 20:54:19 pts/4 0:00 /bin/csh -c ps -fu eug |grep java
      ------------------------------------------------------------

      ======================================================================

            hhuangsunw Hui Huang (Inactive)
            eugsunw Eug Eug (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: