On 06/02/2008, Shardul Kumar,  Chennai <[EMAIL PROTECTED]> wrote:
> Could any one tell me how to debug segmentation fault in net-SNMP.

I presume this is a SegV within the SNMP agent?

The first thing is to determine exactly what triggers the fault.
Does it happen when you run a request, generate a trap, or when?

If it's triggered by a request, then you should try to isolate the
exact OID that causes this.   Run "snmpwalk" and note the
last varbind that is returned.

   Try "snmpgetnext" using this OID - does that trigger the problem?
   Try "snmpgetnext" using the OID of the next expected MIB object
        Does that trigger it?   Similarly for the MIB objects immediately after.

    Try "snmpget" on the exact OID that seems to be affected.
         Does that fail as well, or is it just GETNEXT requests?


Once you're sure you know where the problem is occuring, you can
try running the agent under a debugger.  See the Wiki page
http://net-snmp.sourceforge.net/wiki/index.php/Debugger  for details.

The backtrace ('bt') output should help identify where the fault is
actually being triggered.  The most likely place to look would be the
MIB module handler within that stack trace.   Have a look at the
code in that routine where the offending call occurs.   What is
it doing?  What variables is it using?  What are the values of these
variables?   Do these values seem reasonable.



That should give you enough information to either solve the problem
yourself, or at least allow you to ask a sensible question on the mailing
lists.

Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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