# net-snmpd Segmentation fault

## cbreaker

Okay I've been pulling my hair out for a long time now to no avail.

Both the net-snmp and ucd-snmp packages segfault as soon as they run.

There's no output to the log.  It generates a zero byte file.

If I run:  /usr/sbin/snmpd -f, I see "Segmentation Fault" and it terminates.

I read somewhere that the line "disk / 10000" can cause a seg fault on some systems, but I removed that line and it did the same thing.

I have another Gentoo box with the same ebuild/version of net-snmp installed and it works fine.   Actually, I just copied the snmpd.conf file from it.

Here's my snmpd.conf file:

```
com2sec local     localhost       12345      

com2sec lan       192.168.0.0/16  12345      

com2sec public    any             public

group LocalGroup        v1         local

group LocalGroup        v2c        local

group LocalGroup        usm        local

group LANGroup          v1         lan

group LANGroup          v2c        lan

group LANGroup          usm        lan

group PublicGroup       v1         public

group PublicGroup       v2c        public

group PublicGroup       usm        public

view all    included  .1                               80

access LocalGroup   ""      any       noauth    exact  all    all    none

access LANGroup     ""      any       noauth    exact  all    all    none

access public       ""      any       noauth    exact  all    none   none

syslocation Pawtucket, RI

syscontact Me <Me@somecompany.com>

systype Linux

proc mountd 

proc ntalkd 4 

proc sendmail 10 1 

exec echotest /bin/echo hello world 

 disk / 10000 

load 12 14 14 
```

Here's the last few lines from the log if I turn on debug output (it's empty if I don't use the debug switch):

```
trace: netsnmp_ds_set_boolean(): default_store.c, 67

netsnmp_ds_set_boolean: Setting 0:26 = 1/True

trace: snmp_call_callbacks(): callback.c, 99

callback: START calling callbacks for maj=0 min=3

trace: snmp_call_callbacks(): callback.c, 107

callback: calling a callback for maj=0 min=3
```

Maybe there's some other configuration file I'm supposed to edit and I forgot, I don't know.   I need snmp running on the machine and if I have to completely blow it away and install Gentoo or Debian just to get SNMP then I guess that's what I'll have to do..  somthing that I've only had to do on Windows machines.

----------

## mikepelchy

im having the exact same problem and I can't figure it out for the life of me... it is really starting to drive me insane!!!

----------

## mikepelchy

upon running /usr/bin/snmpcheck -d, i get the error:

```
server root # /usr/bin/snmpcheck -d

Can't locate Term/ReadKey.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i686-linux /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i686-linux /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i686-linux /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at /usr/bin/snmpcheck line 5.
```

----------

## presto8

I'm having this same exact issue... anybody ever find a solution?

Thanks   :Razz: 

----------

## tuxmin

```
emerge TermReadKey
```

should fix this.

Alex!!!

----------

## presto8

Oops, my bad -- I should have been more clear:  I am having the "Segmentation fault" problem, not the TermReadkey problem   :Confused: 

Debugging snmpd is very difficult.  I can't seem to find any log files any where.  It just simply refuses to start without giving a clue as to why...

Argh....

----------

## tuxmin

Start snmpd with -DALL and see if you can find something useful in the logs (see the man page for more detail).

Alex!!!

----------

## presto8

Thanks!  That generated a lot of log entries.  Unfortunately, I didn't see any easy fixes in there and I am still core dumping, but at least I am one step closer.

Thanks for your help.

----------

## mudrii

Did you find the fix, I have the same problem on AMD64 X2  :Sad: 

----------

## mudrii

I fixed recompile net-snmp with standard CFLAGS -pipe O2

----------

