Hi All,

I am facing problem with SET processing in my master agent-sub agent
communication. I am using NET-SNMP 5.4.1. I am doing SNMP SET in three

Here in Reserv1 and Reserve2 I am checking the data type, range and
creating the buffer to send the data.
I am sending final set of buffer to the device in ACTION MODE. Here I
also get the response data from the device. But If the response is
received to UNDO the set request due to some failure condition then I

netsnmp_set_mode_request_error (MODE_SET_ACTION, requests, SNMP_ERR_GENERR);

to roll back(UNDO) the operation.

But when this block of code is HIT then master agent throws
Segmentation Fault exception and got terminated and also subagent is
terminated and it shows the crash point at the same point where the
netsnmp_set_mode_request_error() is called.

I tried to debug the master agent in this scenario,

[root@msatgssoam ~]# gdb /usr/local/sbin/snmpd
GNU gdb Red Hat Linux (6.5-16.el5rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host
libthread_db library "/lib/libthread_db.so.1".

(gdb) run -f -L
Starting program: /usr/local/sbin/snmpd -f -L
[Thread debugging using libthread_db enabled]
[New Thread -1208564000 (LWP 21610)]
netsnmp_assert !"registration != duplicate" failed
agent_registry.c:535 netsnmp_subtree_load()
netsnmp_assert !"registration != duplicate" failed
agent_registry.c:535 netsnmp_subtree_load()
netsnmp_assert !"registration != duplicate" failed
agent_registry.c:535 netsnmp_subtree_load()
Turning on AgentX master support.
Turning on AgentX master support.
NET-SNMP version 5.4.1

Program received signal SIGPIPE, Broken pipe.
[Switching to Thread -1208564000 (LWP 21610)]
0x0040a402 in __kernel_vsyscall ()
(gdb) bt
#0 0x0040a402 in __kernel_vsyscall ()
#1 0x00cea181 in send () from /lib/libpthread.so.0
#2 0x00f52d06 in netsnmp_unix_send (t=0x9b79aa8, buf=0x9bb80b8,
size=20, opaque=0x9bb7384, olength=0x9bb7388) at snmpUnixDomain.c:163
#3 0x00f1f111 in snmp_sess_async_send (sessp=0x9b90e10,
pdu=0x9bb7350, callback=0x823a80 ,
at snmp_api.c:4892
#4 0x00f1f70a in snmp_async_send (session=0x9bb59c8, pdu=0x9bb7350,
callback=0x823a80 , cb_data=0x9bb6778)
at snmp_api.c:4671
#5 0x0082366e in agentx_master_handler (handler=0x9bc9620,
reginfo=0x9bc97e0, reqinfo=0x9bb5cd8, requests=0x9bcb420)
at mibgroup/agentx/master.c:608
#6 0x00822692 in netsnmp_call_handlers (reginfo=0x9bc97e0,
reqinfo=0x9bb5cd8, requests=0x9bcb420) at agent_handler.c:435
#7 0x00811d3a in handle_var_requests (asp=0x9bb4888) at snmp_agent.c:2526
#8 0x00811dc5 in handle_set (asp=0x9bb4888) at snmp_agent.c:3045
#9 0x00812088 in handle_set_loop (asp=0x9bb4888) at snmp_agent.c:3061
#10 0x0081660b in check_delayed_request (asp=0x9bb4888) at snmp_agent.c:2764
#11 0x00816797 in netsnmp_check_outstanding_agent_requests () at
#12 0x00816c57 in netsnmp_remove_delegated_requests_for_session
(sess=0x9bc6478) at snmp_agent.c:1448
#13 0x0083aabd in close_agentx_session (session=0x9bb59c8, sessid=-1)
at mibgroup/agentx/master_admin.c:146
#14 0x0083b090 in handle_master_agentx_packet (operation=5,
session=0x9bb59c8, reqid=0, pdu=0x0, magic=0x0)
at mibgroup/agentx/master_admin.c:490
#15 0x00f248bc in _sess_read (sessp=0x9b90e10, fdset=0xbfa6822c) at
#16 0x00f25619 in snmp_sess_read (sessp=0x9b90e10, fdset=0xbfa6822c)
at snmp_api.c:5791
#17 0x00f2566f in snmp_read (fdset=0xbfa6822c) at snmp_api.c:5408
#18 0x0804c643 in main (argc=3, argv=0xbfa683f4) at snmpd.c:1180

I am unable to understand why master agent is crashing in ACTION mode.
If I do create scenario for RESERV1 and RESERV2 mode (by giving wrong
datatype or invalid range value) then no problem occurs at this point
and subagent is showing the GET Response error properly.

Any help will be highly appreciated.

Thanks in Advance

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
Net-snmp-users mailing list
Please see the following page to unsubscribe or change other options: