snmpd segfaults on startup processing override cmd

John Hardin <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
I'm experiencing a segfault when I use the "override" command
in the snmpd.conf file to set sysDescr.  I'm running Net-SNMP
version 5.4.2.1 built for a 64-bit RHEL5 system.

When it dies, it always dies at the same spot (see back trace below),
but it doesn't always die.  Sometimes it works.  But if I set it up to
kill and restart every 60 seconds, I'll come back in an hour and
have a bunch of cores.

I notice there was a bug a while back (bug #432181) that was closed
as ERRATA and seemed to think the problem had been fixed.  This
from the bug history:

 > crash was fixed for 5.1.3 release line, however the token failed to
 > actually override. Fixed for 5.1.4. Should already be working in 
5.2.x and
 > later releases.
Apparently it's still a problem in 5.4.2.1.  Is anyone else seeing
this problem?


Here's verification of the version I'm running:

     $ snmpwalk -c public -v2c 10.51.6.201 UCD-SNMP-MIB::versionTag
     UCD-SNMP-MIB::versionTag.0 = STRING: 5.4.2.1


Here's the line in the snmpd.conf file that triggers the problem:

     override sysDescr.0 octet_str "Venturi VVO VenturiVVO1000 2.1.0.35"


If I comment out that line, I can start and stop for hours with no cores, so
it's definitely related to the override command.

Here's the backtrace:

     Core was generated by `/usr/local/vvo/snmp/sbin/snmpd -c 
/usr/local/vvo/snmp/snmpd.conf -Lf /usr/local'.
     Program terminated with signal 11, Segmentation fault.
     #0  get_module_node (fname=<value optimized out>, module=<value 
optimized out>, objid=0x7fff15f16330,
         objidlen=0x7fff15f16738) at mib.c:5002
     5002    mib.c: No such file or directory.
         in mib.c
     (gdb) bt
     #0  get_module_node (fname=<value optimized out>, module=<value 
optimized out>, objid=0x7fff15f16330,
         objidlen=0x7fff15f16738) at mib.c:5002
     #1  0x00007ffe0d4ae440 in get_node (name=0x7523b9 "", 
objid=0x7fff15f16330, objidlen=0x7fff15f16738)
         at mib.c:5485
     #2  0x00007ffe0d4b18d5 in snmp_parse_oid (argv=0x7fff15f14330 
"sysDescr.0", root=0x7fff15f16330,
         rootlen=0x7fff15f16738) at mib.c:5860
     #3  0x00007ffe0d7d2477 in netsnmp_parse_override (token=<value 
optimized out>, line=<value optimized out>)
         at utilities/override.c:133
     #4  0x00007ffe0d4e05d0 in run_config_handler (lptr=0x6d2e90, 
token=0x7fff15f16fd0 "override",
         cptr=0x7fff15f173d9 "sysDescr.0 octet_str \"Venturi VVO 
VenturiVVO1000 2.1.0.35\"",
         when=<value optimized out>) at read_config.c:507
     #5  0x00007ffe0d4e07d9 in read_config (filename=0x7bf430 
"/usr/local/vvo/snmp/snmpd.conf",
         line_handler=0x608a20, when=0) at read_config.c:797
     #6  0x00007ffe0d4e216b in read_configs_optional 
(optional_config=<value optimized out>, when=0)
         at read_config.c:844
     #7  0x00007ffe0d4e2464 in read_configs () at read_config.c:871
     #8  0x0000000000403e3e in main ()


Here's the code in mib.c where it dies:

     static int
     node_to_oid(struct tree *tp, oid * objid, size_t * objidlen)
     {
         int             numids, lenids;
         oid            *op;

         if (!tp || !objid || !objidlen)
             return 0;

         lenids = (int) *objidlen;
         op = objid + lenids;        /* points after the last element */

         for (numids = 0; tp; tp = tp->parent, numids++) {
             if (numids >= lenids)
                 continue;
             --op;
             *op = tp->subid; <--- it dies right here
         }

         *objidlen = (size_t) numids;
         if (numids > lenids) {
             return 0;
         }

         if (numids < lenids)
             memmove(objid, op, numids * sizeof(oid));

         return (numids);
     }


Thanks in advance for any light anyone can throw on this.

-John


------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.