On startup I'm getting an immediate SEGV from getMibstat in line of 746, 
which is calling a memcpy. This is running in a solaris sparse zone.

/var/tmp # gdb /usr/local/sbin/snmpd snmpd.11061.core
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.10"...
Reading symbols from /usr/local/lib/libnetsnmpagent.so.25...done.
Loaded symbols for /usr/local/lib/libnetsnmpagent.so.25
Reading symbols from /usr/local/lib/libnetsnmpmibs.so.25...done.
Loaded symbols for /usr/local/lib/libnetsnmpmibs.so.25
Reading symbols from /usr/lib/libkvm.so.1...done.
Loaded symbols for /usr/lib/libkvm.so.1
Reading symbols from /usr/local/lib/libnetsnmp.so.25...done.
Loaded symbols for /usr/local/lib/libnetsnmp.so.25
Reading symbols from /lib/libadm.so.1...done.
Loaded symbols for /lib/libadm.so.1
Reading symbols from /lib/libkstat.so.1...done.
Loaded symbols for /lib/libkstat.so.1
Reading symbols from /usr/local/ssl/lib/libcrypto.so.1.0.0...done.
Loaded symbols for /usr/local/ssl/lib/libcrypto.so.1.0.0
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libsocket.so.1...done.
Loaded symbols for /lib/libsocket.so.1
Reading symbols from /lib/libelf.so.1...done.
Loaded symbols for /lib/libelf.so.1
Reading symbols from /lib/libc.so.1...done.
Loaded symbols for /lib/libc.so.1
Reading symbols from /usr/local/lib/libgcc_s.so.1...done.
Loaded symbols for /usr/local/lib/libgcc_s.so.1
Reading symbols from /lib/libdl.so.1...
warning: Lowest section in /lib/libdl.so.1 is .hash at 000000b4
done.
Loaded symbols for /lib/libdl.so.1
Reading symbols from /platform/sun4v/lib/libc_psr.so.1...done.
Loaded symbols for /platform/SUNW,T5240/lib/libc_psr.so.1
Reading symbols from /lib/ld.so.1...done.
Loaded symbols for /lib/ld.so.1
Core was generated by `/usr/local/sbin/snmpd -Lsd -p /var/run/snmpd.pid'.
Program terminated with signal 11, Segmentation fault.
[New process 76597    ]
#0  0xff3a0594 in memcpy () from /platform/SUNW,T5240/lib/libc_psr.so.1
(gdb) backtrace
#0  0xff3a0594 in memcpy () from /platform/SUNW,T5240/lib/libc_psr.so.1
#1  0xff1f2578 in getMibstat (grid=MIB_INTERFACES, resp=0xffbff5d0, 
entrysize=120, req_type=4280683568,
    comp=0xff1f3e18 <Name_cmp>, arg=0x2d2d8) at kernel_sunos5.c:746
#2  0xff1f3310 in getMibstat (grid=173840, resp=0xffbff6d0, entrysize=224, 
req_type=GET_FIRST,
    comp=0xff1f3e10 <Get_everything>, arg=0x0) at kernel_sunos5.c:1561
#3  0xff225b94 in netsnmp_arch_interface_container_load 
(container=0x2a6a8, l_flags=0)
    at if-mib/data_access/interface_solaris2.c:203
#4  0xff20e220 in netsnmp_access_interface_container_load 
(container=0x2a6a8, load_flags=0)
    at if-mib/data_access/interface.c:159
#5  0xff20e37c in netsnmp_access_interface_init () at 
if-mib/data_access/interface.c:88
#6  0xff227ca8 in init_mib_modules () at mib_modules.c:69
#7  0x00012da4 in main (argc=4, argv=0xffbffc4c) at snmpd.c:913



/tnt/src/PKG/TNTnet-snmp-5.6.1/net-snmp-5.6.1/agent/mibgroup/kernel_sunos5.c:746

int
getMibstat(mibgroup_e grid, void *resp, size_t entrysize,
           req_e req_type, int (*comp) (void *, void *), void *arg)
{
    int             ret, rc = -1, mibgr, mibtb, cache_valid;
    size_t          length;
    mibcache       *cachep;
    found_e         result = NOT_FOUND;
    void           *ep;

    /*
     * We assume that Mibcache is initialized in mibgroup_e enum order so 
we
     * don't check the validity of index here.
     */

    DEBUGMSGTL(("kernel_sunos5", "getMibstat (%d, *, %d, %d, *, *)\n",
                grid, (int)entrysize, req_type));
    cachep = &Mibcache[grid];
    mibgr = Mibmap[grid].group;
    mibtb = Mibmap[grid].table;

    if (cachep->cache_addr == (void *) -1)  /* Hasn't been initialized yet 
*/
        init_mibcache_element(cachep);
    if (cachep->cache_size == 0) {  /* Memory allocation problems */
        cachep->cache_addr = resp;  /* So use caller supplied address 
instead of cache */
        cachep->cache_size = entrysize;
        cachep->cache_last_found = 0;
    }
    if (req_type != GET_NEXT)
        cachep->cache_last_found = 0;

    cache_valid = (cachep->cache_time > 0);

    DEBUGMSGTL(("kernel_sunos5","... cache_valid %d time %ld ttl %d now 
%ld\n",
                cache_valid, cachep->cache_time, (int)cachep->cache_ttl,
    720
    721         if (rc >= 0) {      /* Cache has been filled up */
    722             cachep->cache_time = cachep->cache_ttl;
    723             cachep->cache_length = length;
    724             if (rc == 1)    /* Found but there are more unread 
data */
    725                 cachep->cache_flags |= CACHE_MOREDATA;
    726             else {
    727                 cachep->cache_flags &= ~CACHE_MOREDATA;
    728                 if (rc > 1)  {
    729                     cachep->cache_time = 0;
    730                     }
    731                  }
    732             cachep->cache_comp = (void *) comp;
    733             cachep->cache_arg = arg;
    734         } else {
    735             cachep->cache_comp = NULL;
    736             cachep->cache_arg = NULL;
    737         }
    738     }
    739     DEBUGMSGTL(("kernel_sunos5", "... result %d rc %d\n", result, 
rc));
    740
    741     if (result == FOUND || rc == 0 || rc == 1) {
    742         /*
    743          * Entry has been found, deliver it
    744          */
    745         if (resp != NULL) {
    746             memcpy(resp, ep, entrysize);
    747         }
    748         ret = 0;
    749         cachep->cache_last_found =
    750             ((char *)ep - (char *)cachep->cache_addr) / entrysize;
    751     } else {
    752         ret = 1;            /* Not found */
    753     }
    754     DEBUGMSGTL(("kernel_sunos5", "... getMibstat returns %d\n", 
ret));
    755     return ret;
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to