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

sun.misc.Signal.handle does not work for Signal.raise

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.3.0
    • other-libs
    • generic
    • generic



      Name: dkC59003 Date: 08/18/99



      Classic VMs (from 1.2 to Kestrel fcs) fail to pass the test below (return value is 97)
      both on win32 and Solaris: signal raised with Signal.raise method is not handled by
      a user-defined handler.
      For instance:

      $ java -classic -version
      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-A)
      Classic VM (build 1.3.0-A, native threads, nojit)
      $ java b4222557
      $ echo $?
      97

      The test is passed by HotSpot VMs 1.3beta-C to 1.3beta-J, 1.0.1fcs-G on winNT
      and by HotSpot 1.3beta-N on Solaris.
      The test is failed by HotSpot VMs 1.3beta-K to 1.3beta-N on winNT and by
      HotSpot 1.3beta-M on Solaris.
      The test was developed as a regression test for the bug filed against
      HotSpot 1.0_early_access:
      #4222557 Synopsis: sun.misc.Signal does not work with HotSpot
      (Integrated in releases: 1.0_rc2).

      ----------------------------------------------------------- b4222557.java
      import java.io.PrintStream;
      import sun.misc.*;

      public class b4222557 {

          private static int res = 2/*STATUS_FAILED*/;

          public static void main(String argv[]) {
      System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
          }

          public static int run(String args[], PrintStream out) {

      Signal.handle(new Signal("INT"), new SignalHandler() {
      public void handle(Signal sig) {
      res = 0/*STATUS_PASSED*/;
      }
      });

      Signal.raise(new Signal("INT"));
      return res;
          }
      }

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

            Unassigned Unassigned
            dkhukhrosunw Dmitry Khukhro (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: