[AGENT++] AgentX+ example subagent Crash!!!
冯上
FengSh at capitel.com.cn
Fri Jul 21 09:57:34 CEST 2006
Hi all,
I build snmp++ 3.2.21, agent++ 3.5.27 and agentX++ 1.4.15 under linux 2.
4.20-8 without SNMP v3 support.
When I use agentX supplied example: master and subagent, the subagent
often crash.
I use “snmpset -v 2c -p 4700 localhost public .1.3.6.1.4.1.4976.6.1.2.1
i 3” to test the subagent. When
I repeat this command rapidly for several times(10-20), the subagent
crashes.
I use the original code, except that:
1. #define _NO_SNMPv3 ,
2. Remove the if(***() == version3 ){…} in request.cpp Line 930, or else I
can’t get compile pass.
3. Remove a ( in snmp_pp_ext.cpp Line 1127, it’s a typo ??
4. Change the agentX tcp port to 11705. (I didn’t use root account so I
can’t use 705).
5. #undef AX_UNIX_SOCKET, I use only tcp connection.
Has anybody ever notice this problem? And can you give me some advise??
Here are some detail information:
GDB shows the callstack of the crash point:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1074998208 (LWP 14396)]
0x00000189 in ?? ()
(gdb) bt
#0 0x00000189 in ?? ()
#1 0x080b8063 in Agentpp::Mib::finalize(Agentpp::Request*) (this=0x81651b8,
req=0x8182300)
at mib.cpp:4057
#2 0x0809be69 in
Agentpp::SubAgentXMib::do_process_request(Agentpp::Request*)
(this=0x81651b8,
req=0x8182300) at agentx_subagent.cpp:1031
#3 0x080bc84b in Agentpp::MibTask::run() (this=0x8181b00) at
threads.cpp:920
#4 0x080bb605 in Agentpp::TaskManager::run() (this=0x8176468) at
threads.cpp:742
#5 0x080ba2c2 in Agentpp::thread_starter(void*) (t=0x81764b4) at
threads.cpp:486
#6 0x4001b2b6 in start_thread () from /lib/tls/libpthread.so.0
(gdb)
Master log of the last snmpset command:
20060721.15:54:02: 14268: (2)EVENT : RequestList: request received
(id)(siz)(fro)(ver)(com)(type): (2115175049), (1), (127.0.0.1/46042),
(SNMPv2c), (public), (163)
20060721.15:54:02: 14268: (1)DEBUG : TaskManager: task manager found
20060721.15:54:02: 14268: (2)DEBUG : TaskManager: after notify
20060721.15:54:02: 14268: (2)EVENT : Agent: starting thread execution
(pduType)(subrequests): (163), (1)
20060721.15:54:02: 14268: (2)EVENT : MasterAgentXMib: processing set
request (tid)(phase)(oid)...: (73), (0), (1.3.6.1.4.1.4976.6.1.2.1)
20060721.15:54:02: 14268: (3)EVENT : Agent: preparing set request: (73)
20060721.15:54:02: 14268: (4)EVENT : MasterAgentXMib: queued AgentX
subrequest (sid)(tid)(type): (1), (73), (8)
20060721.15:54:02: 14268: (3)EVENT : MasterAgentXMib: sending AgentX
subrequests (tid): (73)
20060721.15:54:02: 14268: (3)EVENT : AgentX: sending agentx pdu
(sd)(type)(sid)(tid)(pid)(err)(errind): (5), (8), (1), (73), (219), (0), (0)
20060721.15:54:02: 14268: (3)EVENT : MasterAgentXMib: sent AgentX
subrequests (tid)(count): (73), (1)
20060721.15:54:02: 14268: (2)EVENT : Agent: finished thread execution
20060721.15:54:02: 14268: (5)DEBUG : MasterAgentXMib: reading AgentX packet
20060721.15:54:02: 14268: (4)DEBUG : MasterAgentXMib: processing AgentX
packet from (sd)(type): (5), (18)
20060721.15:54:02: 14268: (1)DEBUG : TaskManager: task manager found
20060721.15:54:02: 14268: (2)DEBUG : TaskManager: after notify
20060721.15:54:02: 14268: (4)EVENT : MasterAgentXMib: processing response
(sd)(sid)(tid)(pid)(status)(vbs): (5), (1), (73), (219), (0), (1)
20060721.15:54:02: 14268: (2)EVENT : Agent: starting thread execution
(pduType)(subrequests): (163), (1)
20060721.15:54:02: 14268: (2)EVENT : MasterAgentXMib: processing set
request (tid)(phase)(oid)...: (73), (1), (1.3.6.1.4.1.4976.6.1.2.1)
20060721.15:54:02: 14268: (3)EVENT : Agent: committing set request: (73)
20060721.15:54:02: 14268: (4)EVENT : MasterAgentXMib: queued AgentX
subrequest (sid)(tid)(type): (1), (73), (9)
20060721.15:54:02: 14268: (3)EVENT : MasterAgentXMib: sending AgentX
subrequests (tid): (73)
20060721.15:54:02: 14268: (3)EVENT : AgentX: sending agentx pdu
(sd)(type)(sid)(tid)(pid)(err)(errind): (5), (9), (1), (73), (220), (0), (0)
20060721.15:54:02: 14268: (3)EVENT : MasterAgentXMib: sent AgentX
subrequests (tid)(count): (73), (1)
20060721.15:54:02: 14268: (2)EVENT : Agent: finished thread execution
20060721.15:54:02: 14268: (5)DEBUG : MasterAgentXMib: reading AgentX packet
20060721.15:54:02: 14268: (4)DEBUG : MasterAgentXMib: processing AgentX
packet from (sd)(type): (5), (18)
20060721.15:54:02: 14268: (1)DEBUG : TaskManager: task manager found
20060721.15:54:02: 14268: (2)DEBUG : TaskManager: after notify
20060721.15:54:02: 14268: (4)EVENT : MasterAgentXMib: processing response
(sd)(sid)(tid)(pid)(status)(vbs): (5), (1), (73), (220), (0), (1)
20060721.15:54:02: 14268: (3)EVENT : RequestList: finished subrequest
(ind): (0)
20060721.15:54:02: 14268: (2)EVENT : Agent: starting thread execution
(pduType)(subrequests): (163), (1)
20060721.15:54:02: 14268: (2)EVENT : MasterAgentXMib: processing set
request (tid)(phase)(oid)...: (73), (2), (1.3.6.1.4.1.4976.6.1.2.1)
20060721.15:54:02: 14268: (3)EVENT : Agent: cleaning up set request: (73)
20060721.15:54:02: 14268: (4)EVENT : MasterAgentXMib: queued AgentX
subrequest (sid)(tid)(type): (1), (73), (11)
20060721.15:54:02: 14268: (3)EVENT : MasterAgentXMib: sending AgentX
subrequests (tid): (73)
20060721.15:54:02: 14268: (3)EVENT : AgentX: sending agentx pdu
(sd)(type)(sid)(tid)(pid)(err)(errind): (5), (11), (1), (73), (221), (0),
(0)
20060721.15:54:02: 14268: (3)EVENT : MasterAgentXMib: sent AgentX
subrequests (tid)(count): (73), (1)
20060721.15:54:02: 14268: (4)DEBUG : SNMPMessage: v3MP return value for
build message: (0)
20060721.15:54:02: 14268: (2)EVENT : RequestList: request answered
(rid)(tid)(to)(err)(send)(sz): (2115175049), (73), (127.0.0.1/46042), (0),
(0), (1)
20060721.15:54:02: 14268: (2)EVENT : Agent: finished thread execution
20060721.15:54:02: 14268: (5)DEBUG : MasterAgentXMib: reading AgentX packet
20060721.15:54:02: 14268: (3)WARNING: MasterAgentXMib: lost connection
(sd)(err): (5), (-5)
20060721.15:54:02: 14268: (1)DEBUG : TaskManager: task manager found
20060721.15:54:02: 14268: (2)DEBUG : TaskManager: after notify
20060721.15:54:02: 14268: (2)EVENT : RequestList: request received
(id)(siz)(fro)(ver)(com)(type): (1212220637), (1), (127.0.0.1/46042),
(SNMPv2c), (public), (163)
20060721.15:54:02: 14268: (1)DEBUG : TaskManager: task manager found
20060721.15:54:02: 14268: (2)DEBUG : TaskManager: after notify
20060721.15:54:02: 14268: (2)EVENT : Agent: starting thread execution
(pduType)(subrequests): (163), (1)
20060721.15:54:02: 14268: (2)EVENT : MasterAgentXMib: processing set
request (tid)(phase)(oid)...: (74), (0), (1.3.6.1.4.1.4976.6.1.2.1)
20060721.15:54:02: 14268: (3)EVENT : Agent: preparing set request: (74)
20060721.15:54:02: 14268: (3)EVENT : Agent: cleaning up set request: (74)
20060721.15:54:02: 14268: (3)EVENT : MasterAgentXMib: sending AgentX
subrequests (tid): (74)
20060721.15:54:02: 14268: (3)EVENT : MasterAgentXMib: sent AgentX
subrequests (tid)(count): (74), (0)
20060721.15:54:02: 14268: (4)DEBUG : SNMPMessage: v3MP return value for
build message: (0)
20060721.15:54:02: 14268: (2)EVENT : RequestList: request answered
(rid)(tid)(to)(err)(send)(sz): (1212220637), (74), (127.0.0.1/46042), (11),
(0), (1)
20060721.15:54:02: 14268: (2)EVENT : Agent: finished thread execution
20060721.15:54:03: 14268: (2)EVENT : RequestList: request received
(id)(siz)(fro)(ver)(com)(type): (205953187), (1), (127.0.0.1/46042),
(SNMPv2c), (public), (163)
Subagent log of the last snmpset:
20060721.15:51:29: 14029: (2)EVENT : AgentXRequestList: request received
(context)(tid)(pid)(siz)(type)(err)(status): (), (58), (174), (1), (8), (0),
(0)
20060721.15:51:29: 14029: (1)DEBUG : TaskManager: task manager found
20060721.15:51:29: 14029: (2)DEBUG : TaskManager: after notify
20060721.15:51:29: 14029: (2)EVENT : SubAgent: starting thread execution
20060721.15:51:29: 14029: (2)EVENT : SubAgentXMib: TESTSET
(tid)(pid)(oid)...: (58), (174), (1.3.6.1.4.1.4976.6.1.2.1)
20060721.15:51:29: 14029: (3)EVENT : Agent: preparing set request: (58)
20060721.15:51:29: 14029: (3)EVENT : AgentX: sending agentx pdu
(sd)(type)(sid)(tid)(pid)(err)(errind): (3), (18), (1), (58), (174), (0),
(0)
20060721.15:51:29: 14029: (4)EVENT : RequestListAgentX: request answered
(id)(status)(tid)(err)(removed)(sz): (58), (0), (58), (0), (0), (1)
20060721.15:51:29: 14029: (2)EVENT : Agent: finished thread execution
20060721.15:51:29: 14029: (4)DEBUG : AgentXSlave: received something on
ports
20060721.15:51:29: 14029: (2)EVENT : AgentXRequestList: request received
(context)(tid)(pid)(siz)(type)(err)(status): (), (58), (175), (0), (9), (0),
(0)
20060721.15:51:29: 14029: (1)DEBUG : TaskManager: task manager found
20060721.15:51:29: 14029: (2)DEBUG : TaskManager: after notify
20060721.15:51:29: 14029: (2)EVENT : SubAgent: starting thread execution
20060721.15:51:29: 14029: (2)EVENT : SubAgentXMib: COMMITSET
(tid)(pid)(oid)...: (58), (175), (1.3.6.1.4.1.4976.6.1.2.1)
20060721.15:51:29: 14029: (3)EVENT : Agent: committing set request: (58)
20060721.15:51:29: 14029: (3)EVENT : RequestList: finished subrequest
(ind)(oid)(val)(syn): (0), (1.3.6.1.4.1.4976.6.1.2.1), (3), (2)
20060721.15:51:29: 14029: (3)EVENT : AgentX: sending agentx pdu
(sd)(type)(sid)(tid)(pid)(err)(errind): (3), (18), (1), (58), (175), (0),
(0)
20060721.15:51:29: 14029: (4)DEBUG : AgentXSlave: received something on
ports
20060721.15:51:29: 14029: (2)EVENT : AgentXRequestList: request received
(context)(tid)(pid)(siz)(type)(err)(status): (), (58), (176), (0), (11),
(0), (0)
20060721.15:51:29: 14029: (4)EVENT : RequestListAgentX: request answered
(id)(status)(tid)(err)(removed)(sz): (58), (0), (58), (0), (0), (1)
20060721.15:51:29: 14029: (1)DEBUG : TaskManager: task manager found
20060721.15:51:29: 14029: (2)DEBUG : TaskManager: after notify
20060721.15:51:29: 14029: (2)EVENT : SubAgent: starting thread execution
20060721.15:51:29: 14029: (2)EVENT : SubAgentXMib: CLEANUPSET
(tid)(pid)(oid)...: (58), (176), (1.3.6.1.4.1.4976.6.1.2.1)
20060721.15:51:29: 14029: (3)EVENT : Agent: cleaning up set request: (58)
Segmentation fault, aborting.
Thanks
冯上 Shang Feng
More information about the AGENTPP
mailing list