2009/4/28 inyaven sakarai <[email protected]>:
> # gdb /usr/local/sbin/snmpd ./core.snmpd.20701
> BACKTRACE
> (gdb) bt
> #0  0xfed31d50 in strlen () from /usr/lib/libc.so.1
> #1  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
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to