Title: Message
 
All,
 
We have observed the same behavior (subagent crashed immediately after SNMPD is crashed), three times.
Subagent crashed at the following line 5356 in file snmp_api.c, function _sess_read().
 
 if (!fdset || !(FD_ISSET(transport->sock, fdset))) {
The reason for the crash was that transport->sock had the value set to -1. To avoid this crash in subagent, can the code be changed to check the value of "transport->sock" before calling FD_ISSET(). If transport->sock is set to -1, then return from the function.
 
We would like to know if this change will have any impact on SNMPD as the same code is used by Subagent and SNMPD.
 
Please let us know your comments/suggestions on this.
 
To addon, following are the stacks during SNMPD and Subagent crash respectively.
 
 ======================== snmpd crash =================================
gdb>bt
#0  agentx_master_handler (handler=0x10084300, reginfo=0x100af770, reqinfo=0x100d02e0, requests=0x100ca220)
    at mibgroup/agentx/master.c:506
#1  0x0ff11ffc in agentx_master_handler (handler=0x10084300, reginfo=0x100af770, reqinfo=0x100d02e0, requests=0x100ca220)
    at mibgroup/agentx/master.c:504
#2  0x0ff11ffc in agentx_master_handler (handler=0x10084300, reginfo=0x100af770, reqinfo=0x100d02e0, requests=0x100ca220)
    at mibgroup/agentx/master.c:504
#3  0x0ff11ffc in agentx_master_handler (handler=0x10084300, reginfo=0x100af770, reqinfo=0x100d02e0, requests=0x100ca220)
    at mibgroup/agentx/master.c:504
#4  0x0ff11ffc in agentx_master_handler (handler=0x10084300, reginfo=0x100af770, reqinfo=0x100d02e0, requests=0x100ca220)
    at mibgroup/agentx/master.c:504
#5  0x0ff11ffc in agentx_master_handler (handler=0x10084300, reginfo=0x100af770, reqinfo=0x100d02e0, requests=0x100ca220)
    at mibgroup/agentx/master.c:504
#6  0x0ff11ffc in agentx_master_handler (handler=0x10084300, reginfo=0x100af770, reqinfo=0x100d02e0, requests=0x100ca220)
    at mibgroup/agentx/master.c:504
#7  0x0ff11ffc in agentx_master_handler (handler=0x10084300, reginfo=0x100af770, reqinfo=0x100d02e0, requests=0x100ca220)
    at mibgroup/agentx/master.c:504
#8  0x0ff11ffc in agentx_master_handler (handler=0x10084300, reginfo=0x100af770, reqinfo=0x100d02e0, requests=0x100ca220)
    at mibgroup/agentx/master.c:504
#9  0x0ff11ffc in agentx_master_handler (handler=0x10084300, reginfo=0x100af770, reqinfo=0x100d02e0, requests=0x100ca220)
    at mibgroup/agentx/master.c:504
warning: Previous frame inner to this frame (corrupt stack?)
================== ncs_snmp_subagt crash ====================
bt
#0  0x0fad9b50 in _sess_read (sessp=0x100365c8, fdset=0x33029370) at snmp_api.c:5356
#1  0x0fad9aa8 in _sess_read (sessp=0x100365c8, fdset=0x33029370) at snmp_api.c:5341
#2  0x0fad9aa8 in _sess_read (sessp=0x100365c8, fdset=0x33029370) at snmp_api.c:5341
#3  0x0fad9aa8 in _sess_read (sessp=0x100365c8, fdset=0x33029370) at snmp_api.c:5341
#4  0x0fad9aa8 in _sess_read (sessp=0x100365c8, fdset=0x33029370) at snmp_api.c:5341
#5  0x0fad9aa8 in _sess_read (sessp=0x100365c8, fdset=0x33029370) at snmp_api.c:5341
#6  0x0fad9aa8 in _sess_read (sessp=0x100365c8, fdset=0x33029370) at snmp_api.c:5341
warning: Previous frame inner to this frame (corrupt stack?)
Any idea in which case the call stack looks like above, even if the functions are not recursive? 
Any ideas? Please help.
 
Regards,
Suresh.
 
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pamidipati Suresh-G20238
Sent: Wednesday, July 26, 2006 2:58 PM
To: [email protected]
Subject: SNMPD and Subagent crashed

All,
 
We are using Net-snmp-5.2.2 as Master and Subagent.
We observed that both snmpd and subagent are crashed in one scenario.
 
1. snmpd crashed in the function snmp_oid_compare(). One of the function argument, OID2 was having the value 0x0, which resulted in crash.
2. Subagent crashed at the following line (line number 5356) in the file snmp_api.c, function _sess_read(). 
 
 if (!fdset || !(FD_ISSET(transport->sock, fdset))) {
When we checked the value of transport->sock, it has value -1.
 
Subagent crash happened immediately after SNMPD crash. We have gone through the code to find out the reason for Subagent crash and found that transport->sock is set to -1 in netsnmp_tcp_close() function which is called when the Subagent detects that TCP connection with SNMPD is down. Even if SNMPD crashes/stops running for some reason, subagent should not crash. We are not able to find the reason for this behavior.
 
Please let us know if any of you has observed similar behavior. Any information on this will be really helpful.
 
Thanks,
Suresh.
 
 
 
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to