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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 1.3.0
    • Fix Version/s: None
    • Component/s: other-libs
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description



      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;
          }
      }

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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: