Re: segmentation fault

Michael Baer <[email protected]> Mon, 29 Sep 2003 17:39:35 -0700
Newsgroups gmane.network.net-policy.user
Organization OpenSNMP/Net-SNMP
Message-ID <[email protected]>
>>>>> "Ramon" == Ramon Tarruella <[email protected]> writes:

    Ramon> Wes here are both results: [root@ramon root]# gdb np-distd

    Ramon> Program received signal SIGSEGV, Segmentation fault.
    Ramon> [Switching to Thread 1078328224 (LWP 4616)] 0x4020f206 in
    Ramon> getNode (oidlen=11, oid=0xbfffe3a0) at smi.c:140 140
    Ramon> for(nodePtr = smiHandle->rootNodePtr, i=0; i < oidlen; i++)
    Ramon> { (gdb) where
    Ramon> #0 0x4020f206 in getNode (oidlen=11, oid=0xbfffe3a0) at
    Ramon> #smi.c:140 1 0x40210178 in smiGetNodeByOID (oidlen=11,
    Ramon> #oid=0xbfffe3a0) at smi.c:953 2 0x080c86c6 in
    Ramon> #OID::toDisplayString(oid_display_types) const () 3
    Ramon> #0x080c902d in OID::operator std::string() const () 4
    Ramon> #0x080d84e4 in VarBind::operator std::string() const () 5
    Ramon> #0x080ed462 in PersistentVarBind::operator std::string()
    Ramon> #const () 6 0x080c0d4b in operator<<(std::ostream&,
    Ramon> #asnDataType const&) () 7 0x080a1225 in
    Ramon> #snmpEngine::snmpEngine() () 8 0x0808c631 in
    Ramon> #snmpCGArch::init(snmpFIFOObj*&, snmpFIFOObj*&) () 9
    Ramon> #0x08083e3a in CG::CG() () 10 0x08069c0d in
    Ramon> #__static_initialization_and_destruction_0(int, int) () 11
    Ramon> #0x0806bd07 in _GLOBAL__I_Debug () 12 0x08157c4d in
    Ramon> #__do_global_ctors_aux () 13 0x080516f9 in _init () 14
    Ramon> #0x08157bda in __libc_csu_init () 15 0x42015539 in
    Ramon> #__libc_start_main () from /lib/tls/libc.so.6

I found the seg-fault error. It's in OpenSNMP and has been fixed in
CVS. You can update and recompile or you can just comment out the line

opensnmp/app/snmpEngine.C:27 
'DEBUG9_L(debugObj, " and engine id is '" << psSnmpEngineId << "'");'

or just move it down to the end of the procedure.

Strange that it does not cause problem when testing the opensnmp cg
application. It really should fail there as well (and I would have caught it
then!).


Mike

-- 
[email protected]
OpenSNMP/NetSNMP


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf