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

1.3.1_0X Only: IllegalArgumentException: Signal already used by VM: SIGHUP

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.3.1_14
    • 1.3.1_12
    • hotspot
    • b01
    • sparc
    • solaris_8

      Synopsis: java.lang.IllegalArgumentException: Signal already used by VM: SIGHUP

      Description: If I run an application as a cron job using java version 1.3.1_06, the application runs fine.

      If I then run the application as a cron job using java version 1.3.1_09, the application fails with the same error as below i.e.
      java.lang.IllegalArgumentException: Signal already used by VM: SIGHUP

      So it seems to be jre 1.3.1_09 that is causing the problem.

      To reproduce the error:

      I took the java code and recompiled it without any Ranos specifics..(i.e. removed mibaccesss part)
      recompiled it and tried, I get the same problem when running under nohup:
      {root} #: nohup java -classpath . MoScriptSignalHandler
      Sending output to nohup.out
      {root} #: cat nohup.out
      Exception in thread "main" java.lang.IllegalArgumentException: Signal already used by VM: SIGHUP
              at sun.misc.Signal.handle(Signal.java:147)
              at MoScriptSignalHandler.main(MoScriptSignalHandler.java:38)



      ----------------------------------------------------------------

      Original file MoScriptSignalHandler.java below:

      /*------------------------------------------------------------------------
       *
       *
       * COPYRIGHT (C) ERICSSON RADIO SYSTEMS AB, 2000
       *
       * The copyright to the document(s) herein is the property of
       * Ericsson Radio Systems AB, Sweden.
       *
       * The document(s) may be used and/or copied only with the written
       * permission from Ericsson Radio Systems AB or in accordance with
       * the terms all conditions stipulated in the agreement/contract
       * under which the document(s) have been supplied.
       *
       *------------------------------------------------------------------------
       */

      /*
       *
       * File name: MoScriptSignalHandler
       *
       * Author: Buhr
       *
       */

      /*--------------------------------------------------------------------------*/
      /* <CLEARCASE HISTORY> */
      /* */


      package com.ericsson.nms.umts.ranos.cms.moscript;

      // SUN
      import sun.misc.Signal;
      import sun.misc.SignalHandler;

      /**
       * This class handles Unix signals. The class rolls back active transactions
       * before the JVM is terminated (if the user kills the process).
       * This is in order to avoid to leave locked MOs.
       */
      class MoScriptSignalHandler
      {
          //This signal means that another process is trying to abort your process.
          private static final String SIG_ABRT = "ABRT";
          // This signal indicates that a Ctrl+Break key sequence was pressed under Windows.
          private static final String SIG_BREAK = "BREAK";
          //This signal means that another process is trying to terminate your process.
          private static final String SIG_TERM = "TERM";
          private static final String SIG_QUIT = "QUIT";
          // This signal indicates that a segment violation has taken place.
          private static final String SIG_SEGV = "SEGV";
          //This signal catches floating point exceptions.
          private static final String SIG_FPE = "FPE";
          //This signal indicates that an illegal instruction has been attempted.
          private static final String SIG_ILL = "ILL";
          //This signal indicates that a Ctrl+C key sequence was pressed under Windows
          private static final String SIG_INT = "INT";
          private static final String SIG_HUP = "HUP";

          // Reference to the MibAccess class to terminate
          private static MibAccess mibAccess = null;

      private static SelfMgtMibAccess selfMgtmibAccess = null;

          private MoScriptSignalHandler() {
          }

          private static class MySignalHandler implements SignalHandler
          {
      public void handle(Signal aSignal)
      {
      System.out.println( "Caught " + aSignal.toString() + " signal.");
      mibAccess.rollbackTransaction();
      }
          }

          public static void initiate(MibAccess theMibAccess)
          {
      mibAccess = theMibAccess;

      SignalHandler sigHdl = new MySignalHandler();

      Signal.handle(new Signal(SIG_HUP), sigHdl);
      Signal.handle(new Signal(SIG_INT), sigHdl);

          }

      public static void initiate(SelfMgtMibAccess theMibAccess)
      {
      selfMgtmibAccess = theMibAccess;

      SignalHandler sigHdl = new MySignalHandler();

      Signal.handle(new Signal(SIG_HUP), sigHdl);
      Signal.handle(new Signal(SIG_INT), sigHdl);

          }
      }

      ---------------------------------------------------

      Test file MoScriptSignalHandler.java below:

      import sun.misc.Signal;
      import sun.misc.SignalHandler;

      class MoScriptSignalHandler
      {
          //This signal means that another process is trying to abort your process.
          private static final String SIG_ABRT = "ABRT";
          // This signal indicates that a Ctrl+Break key sequence was pressed under Windows.
          private static final String SIG_BREAK = "BREAK";
          //This signal means that another process is trying to terminate your process.
          private static final String SIG_TERM = "TERM";
          private static final String SIG_QUIT = "QUIT";
          // This signal indicates that a segment violation has taken place.
          private static final String SIG_SEGV = "SEGV";
          //This signal catches floating point exceptions.
          private static final String SIG_FPE = "FPE";
          //This signal indicates that an illegal instruction has been attempted.
          private static final String SIG_ILL = "ILL";
          //This signal indicates that a Ctrl+C key sequence was pressed under Windows
          private static final String SIG_INT = "INT";
          private static final String SIG_HUP = "HUP";

          private MoScriptSignalHandler() {
          }

          private static class MySignalHandler implements SignalHandler
          {
      public void handle(Signal aSignal)
      {
      System.out.println( "Caught " + aSignal.toString() + " signal.");
      }
          }

      public static void main(String[] args)
      {

      SignalHandler sigHdl = new MySignalHandler();
      Signal.handle(new Signal(SIG_HUP), sigHdl);
      Signal.handle(new Signal(SIG_INT), sigHdl);
      System.out.println( "hello");

          }

      }
      ###@###.### 10/15/04 18:47 GMT

            chrisphi Chris Phillips
            rverabel Raghu Verabelli (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: