[AGENT++] SNMP agent crashes after signal handling

VISSCHERS Goswin goswin.visschers at eurocontrol.int
Fri Oct 24 12:00:57 CEST 2003


Hello,

 

I' have a problem with my SNMP agent.

 

After the agent catches a signal SIGVTALRM, while processing a SNMP request, 

It crashes at the moment it finishes the signal handling and jumps back to the SNMP request.

 

I configured the signal like this:

    

    sigViAlarmAction.sa_handler = sig;

    sigViAlarmAction.sa_flags = SA_ONSTACK | SA_RESTART;

    sigaction(SIGVTALRM, &sigViAlarmAction, 0);

    sigaddset(&signalSettings, SIGVTALRM);

    sigViAlarmAction.sa_mask = signalSettings;

 

    virTimeValue.tv_sec = 1;

    virTimeValue.tv_usec = 0;    

    firstTimeValue.tv_sec = 5;

    firstTimeValue.tv_usec = 0;

 

    timeInterval.it_interval = virTimeValue;

    timeInterval.it_value = firstTimeValue;

    setitimer(ITIMER_VIRTUAL, &timeInterval, 0);

    

    The last lines of the logging show this:

    Notice the missing log information in front on "sig(int signo)".

 

20031024.10:42:14: 4627: (4)INFO   : Processed SNMP request.

20031024.10:42:14: 4627: (2)INFO   : Process select

20031024.10:42:14: 4627: (3)EVENT  : Received select for SNMP request.

20031024.10:42:14: 4627: (2)EVENT  : RequestList: request received (id)(siz)(fro)(ver)(com)(type): (2165760), (5), (127.0.0.1/46763), (SNMPv1), (public), (160)

20031024.10:42:14: 4627: (2)EVENT  : Agent: starting thread execution (pduType)(subrequests): (160), (5)

20031024.10:42:14: 4627: (2)EVENT  : Mib: process request: get request, oid: (1344), (1.3.6.1.4.1.2363.3.8.4.2.2.8.1.6.8.81.83.73.67.45.66.88.76), (1.3.6.1.4.1.2363.3.8.4.2.2.8.1.4.8.81.83.73.67.45.66.88.76), (...

20031024.10:42:14: 4627: (3)EVENT  : Mib: process subrequest: get request, oid: (1344), (1.3.6.1.4.1.2363.3.8.4.2.2.8.1.6.8.81.83.73.67.45.66.88.76)

20031024.10:42:14: 4627: (3)EVENT  : RequestList: finished subrequest (ind)(oid)(val)(syn): (0), (1.3.6.1.4.1.2363.3.8.4.2.2.8.1.6.8.81.83.73.67.45.66.88.76), (2), (2)

20031024.10:42:14: 4627: (3)EVENT  : Mib: process subrequest: get request, oid: (1344), (1.3.6.1.4.1.2363.3.8.4.2.2.8.1.4.8.81.83.73.67.45.66.88.76)

20031024.10:42:14: 4627: (3)EVENT  : RequestList: finished subrequest (ind)(oid)(val)(syn): (1), (1.3.6.1.4.1.2363.3.8.4.2.2.8.1.4.8.81.83.73.67.45.66.88.76), (2), (2)

20031024.10:42:14: 4627: (3)EVENT  : Mib: process subrequest: get request, oid: (1344), (1.3.6.1.4.1.2363.3.8.4.2.2.8.1.5.8.81.83.73.67.45.66.88.76)

sig(int signo)

20031024.10:42:14: 4627: (3)INFO   : SubAgent::Instance

20031024.10:42:14: 4627: (3)INFO   : 5 seconds cpu time interval.

20031024.10:42:14: 4627: (3)INFO   : getTimeStamp1

20031024.10:42:14: 4627: (3)INFO   : getTimeStamp2

20031024.10:42:14: 4627: (3)INFO   : intToStr

20031024.10:42:14: 4627: (3)INFO   : CPU load below 5% over the last 43 seconds.

20031024.10:42:14: 4627: (3)INFO   : getTimeStamp1

20031024.10:42:14: 4627: (3)INFO   : getTimeStamp2

20031024.10:42:14: 4627: (3)INFO   : 5 seconds cpu time interval leaving

pure virtual method called

Abort

 

The startcode of the signal handling function looks like this, i think it should be OK:

 

    static void sig(int signo)

    {

        string logMsg = "sig(int signo)";

        LOG_BEGIN(INFO_LOG | 3);

        LOG(logMsg.c_str());

        LOG_END;

 

Can anyone help me with this problem? I think it has something to do with threads.

 

Regards,

Goswin Visschers


____

This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful.

Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL unless it is confirmed by appropriately signed hard copy.

Any views expressed in this message are those of the sender.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.agentpp.org/pipermail/agentpp/attachments/20031024/2bd4f7a1/attachment.htm 


More information about the AGENTPP mailing list