|
Description
|
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
* customer Systems AB, Sweden.
*
* The document(s) may be used and/or copied only with the written
* permission from customer 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");
}
}
xxxxx@xxxxx 10/15/04 18:47 GMT
|
|
Evaluation
|
See comments.
2004-08-12_17_28 GMT:
Test works properly with change as suggested by Karen:
--- before fix:
283 % nohup ./j2sdk1_3_1_13/bin/java -classpath . MoScriptSignalHandler
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)
After fix ----- :
287 % ./j2sdk1_3_1_13/bin/java -version
java version "1.3.1_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_13-b02)
Java HotSpot(TM) Client VM (build 1.3.1_13-TESTFIX-5084917-Ericsson-2004.08.11-chrisphi, mixed mode)
288 % nohup ./j2sdk1_3_1_13/bin/java -classpath . MoScriptSignalHandler
hello
(See suggested fix for actual diffs.)
The updated libjvm's are available:
/net/altair.east/eng/chrisphi/5084917/1_3_1_13+fix5084917_libjvms.tar.Z
or an updated jdk:
/net/altair.east/eng/chrisphi/5084917/j2sdk1_3_1_13+fix5084917.tar.Z
xxxxx@xxxxx 2004-08-12
|