1833514 Members
2817 Online
110061 Solutions
New Discussion

snmpdm coredumps

 

snmpdm coredumps

Hi,

I have a VM running 11.23 where the snmp daemons refuse to run. I have other identical virtual machines that have no problem. Okay, obviously they are not identical because it runs there, but they are on the same software versions/patches. Even the Microsoft solution (rebooting) didn't help. Here's what I get if I run the snmpdm command myself:

(root@sapbde)# snmpdm -apall -n
SNMP Research SNMP Agent Resident Module Version 15.3.1.0
Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 SNMP Research, Inc.
Successfully opened log file /var/adm/snmpd.log
at line 593 in file ../mastmain.c
init_fnames: searching for configuration files in /etc/srconf/agt (default)
at line 134 in file ../../../snmpd/shared/fnames.c
Binding to port 161
at line 482 in file /view/anu.IA.6.2/DE/snmpr/seclib/t_ip.c
Attempt #5 to bind to socket
at line 484 in file /view/anu.IA.6.2/DE/snmpr/seclib/t_ip.c
GetLocalIPAddress: hostname is sapbde
at line 166 in file /view/anu.IA.6.2/DE/snmpr/seclib/t_ip.c
Memory fault(coredump)

I haven't been able to find any differences in any configuration files I know of (/etc/rc.config.d/SnmpMaster.conf or /etc/snmpd.conf. The only line there is trap-dest: xxxx.xxxx.com)

Any help would be appreciated.

Thanks,

Dave
@&$#! I thought I commented that out!
12 REPLIES 12
Steven E. Protter
Exalted Contributor

Re: snmpdm coredumps

Shalom Dave,

Microsoft solution. Cute phrase but so true.

I would check the patch levels of the working VM machines against this one. Perhaps a critical patch for snmp is missing.

swlist -l product

Maybe use diff to compare the output.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com

Re: snmpdm coredumps

Thanks for the idea. I did just assume that the servers were patched the same but I hadn't actually bothered to check. The servers are only a few months old.

Unfortunately, they are patched identically and on the same software versions.

Thanks,

Dave
@&$#! I thought I commented that out!
Padma Asrani
Honored Contributor

Re: snmpdm coredumps

Hi David

Could you write a sample C program on the machine where it is dumping core to evaluate this call

LocalIPAddress = inet_addr(hostname);

Regards
Padma

Re: snmpdm coredumps

C program, huh? Okay, it's been a little while and I never did much with the network stuff, but I cribbed this together:

#include
#include
#include
#include


int main () {

struct sockaddr_in sa;

sa.sin_addr.s_addr = inet_addr("xxx");
printf ("%s\n",sa.sin_addr.s_addr);
}

The result? "Memory fault(coredump)"

The interesting thing (and which makes my program suspicious) is that I get the same result on the other VM guests and the host as well, even though the snmpdm is running on them.

So, obvious bug in my C program or a bug in my server configurations?

Thanks much,

Dave
@&$#! I thought I commented that out!
Dennis Handly
Acclaimed Contributor

Re: snmpdm coredumps

printf("%s\n",sa.sin_addr.s_addr);
>obvious bug in my C program

If you used a real C compiler it would have told you the format was wrong:
warning #2181-D: argument is incompatible with corresponding format string conversion

The right format is %lx in 32 bit mode and %x in 64 bit mode.
Padma Asrani
Honored Contributor

Re: snmpdm coredumps

Hi David,

Sorry for coming late on this. Is it okay with you to get me the core file and snmpd.conf file . I can try to get you the c program which you can run on your system.

Padma

Re: snmpdm coredumps

Yep, that was an obvious bug. Sorry about that.

The revised program returns 'ffffff' with the nodename and 'a5688e6b' with the IP (wasn't positive which one to use).

I've attached the core file. /etc/snmpd.conf file only has one line: trap-dest: xxxx.xxxx.com
@&$#! I thought I commented that out!
Dennis Handly
Acclaimed Contributor

Re: snmpdm coredumps

>I've attached the core file.

Corefiles are useless if you are not on the original machine. You must use gdb's packcore so you capture ALL of the loadmodules used by the application.

All I get is:
ELF-32 core file - IA64 from 'snmpdm' - received SIGSEGV

But you can use gdb and get a stack trace:
$ gdb snmpdm core
(gdb) bt
(gdb) info reg
(gdb) disas $pc-16*8 $pc+16*4
(gdb) q

Re: snmpdm coredumps

Hi,

Sorry to be obtuse, but I can't find gdb for 11.23. I did find a website 'Merjin's HP-UX software for ITRC users' that says gdb is not supported under 11.23. Is this still true? If not, where can I find it (not hpux.cs.utah.edu, apparently) and if so, is there a different debugger available?

Thanks,

Dave
@&$#! I thought I commented that out!
Dennis Handly
Acclaimed Contributor

Re: snmpdm coredumps

>but I can't find gdb for 11.23.

You should use HP's gdb:
http://www.hp.com/go/wdb

Re: snmpdm coredumps

Okay, finally got _that_ installed.

Ran commands listed above and attached the output. I'm sad to say it doesn't mean a whole lot to me...

Thanks again.
@&$#! I thought I commented that out!
Dennis Handly
Acclaimed Contributor

Re: snmpdm coredumps

>I'm sad to say it doesn't mean a whole lot to me.

Not much to me either unless I look into it more or I'm able to run it in the debugger.

Perhaps it will be useful to Padma?

Basically what you have is a null pointer dereference in readSnmpdConf:
#0 0x4054b60:0 in readSnmpdConf+0x680
#1 0x4030690:0 in InitMaster+0xac0
#2 0x4029970:0 in main+0x550

: br.call.dptk.few b0=0x4054300;; HpTranslateAddress
: addp4 r8=0,r8
: ld4 r8=[r8]
: addp4 r9=5,r8;;
: st1 [r9]=r57 <<<<

The result from HpTranslateAddress contains a pointer to a pointer, which contains a null pointer, R8. 5 is being added to it, giving R9. And we die on the store.