[prev in list] [next in list] [prev in thread] [next in thread]
List: net-snmp-coders
Subject: Re: Core dump
From: Dave Shield <D.T.Shield () liverpool ! ac ! uk>
Date: 2009-04-28 7:33:42
Message-ID: c64ae3380904280033j532f8b1csf45ee7b284e172ee () mail ! gmail ! com
[Download RAW message or body]
2009/4/28 inyaven sakarai <iniyaven@yahoo.com>:
> # gdb /usr/local/sbin/snmpd ./core.snmpd.20701
> BACKTRACE
> (gdb) bt
> #0=A0 0xfed31d50 in strlen () from /usr/lib/libc.so.1
> #1=A0 0xff26bdfc in var_hrswinst () from /usr/local/lib/libnetsnmpmibs.so=
.15
[snip]
It's a bit difficult to be sure what's gone wrong with this level of detail=
.
Ideally, this output ought to include line numbers as well, so we
could tell exactly where the problem is occurring.
But there are only a few mentions of 'strlen' in hr_swinst.c
And given that this is a Solaris box, the I suspect that problem
lies with the handling of pkgparam(..., "VERSION")
I'm attaching a patch that might possibly help.
Note that you'll need to apply this to a source distribution,
and recompile the software.
Dave
["pkgparam.patch" (text/x-patch)]
Index: agent/mibgroup/host/hr_swinst.c
===================================================================
--- agent/mibgroup/host/hr_swinst.c (revision 17417)
+++ agent/mibgroup/host/hr_swinst.c (working copy)
@@ -417,7 +417,7 @@
#ifdef HAVE_PKGINFO
pver = pkgparam(swi->swi_name, "VERSION");
/* 1 spot for the terminating null and one for the dash */
- if (strlen(pver) + 2 + strlen(string) <= sizeof(string)) {
+ if (pver && strlen(pver) + 2 + strlen(string) <= sizeof(string)) {
strcat(string, "-");
strcat(string, pver);
}
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic