# Error on loading SNMP daemon [Solved]

## gijsg03

I'm trying to start my snmpd, but I've got an error in my kern.log file and the daemon won't start.

```
snmpd[27073]: segfault at 0000000000000000 rip 00002b3874854c20 rsp 00007fff37a972f8 error 4
```

In my net-snmpd.log file I don't get any error. I've tried to install (read: emerge) different releases of version 5.4, but all got the same error. I also have seeked on Google, but I can't find an answer of my problem. Hopefully anyone of you give me some hints?   :Laughing: 

Below my snmpd.conf:

```

com2sec local   127.0.0.1/32                    public

com2sec local   172.20.128.248/29               public

com2sec local   192.168.64.224/27               public

com2sec local   192.168.192.224/27              public

com2sec local   192.168.224.224/27              public

group MyROGroup v1      local

group MyROGroup v2c     local

group MyROGroup usm     local

view all    included  .1        80

access MyROGroup ""     any     noauth  exact   all     none    none

access MyRWGroup ""     any     noauth  exact   all     all     none

access MyROSystem ""    any     noauth  exact   system  none    none

syslocation Home

syscontact Administrator <administrator@mydomain.nl>

```

Thanks for all of your help!

----------

## gerdesj

First thought: run "revdep-rebuild"

Here is a known working minimal snmpd.conf. make sure you set your network in the first rocommunity:

```
rouser  public noauth public

rocommunity  public 192.168.100.0/24

rocommunity  public 127.0.0.1/32

trap2sink  127.0.0.1 public

informsink  127.0.0.1 public

trapcommunity  public

syslocation Here

syscontact Me
```

Any joy?

Cheers

Jon

----------

## gijsg03

Sorry, no result   :Crying or Very sad: . I have to go now, but tomorrow I try to downgrade. I you have other suggestions, please let me know. Thanks for your help anyway!  :Laughing: 

----------

## gijsg03

I have downgraded version net-snmp-5.4.1-r3 back to release 1. I've got the same message in my kern.log file. But I also get an error in the net-snmpd.log:

```
netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()
```

I have googled this message and the solution is to patch the agent_registry.c file, but how???? In this release I don't have a file with this name.

I don't know what to do. Anyone?

----------

## gerdesj

 *gijsg03 wrote:*   

> I have downgraded version net-snmp-5.4.1-r3 back to release 1. I've got the same message in my kern.log file. But I also get an error in the net-snmpd.log:
> 
> ```
> netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()
> ```
> ...

 

What version of snmp are you running, also what arch?

Cheers

Jon

----------

## gijsg03

I'm now running version net-analyzer/net-snmp-5.4.1-r1. I already downgraded to version 5.3 and version 5.2, but all with the same result. I don't know exactly what you mean with "what arch". 

Thanks for reactions!

----------

## gerdesj

By arch I mean x86, amd64 etc etc. Your /etc/make.profile is a symlink to your profile and it will have the arch in the path: /usr/portage/profiles/default-linux/<ARCH>

Could you also post the contents of /etc/conf.d/snmpd

Cheers

Jon

----------

## gijsg03

Hello Gerdesj,

Sorry for my late reaction   :Embarassed: , but I wasn't be able to give you a reaction on a earlier time. Excuses for that. But from now on I'm fully be able to solve this problem.   :Laughing: 

The ARCH I'm using is 'amd64'. I'm running on a Asus motherboard with a P35 chipset and a 'Intel(R) Core(TM)2 Duo CPU E6750' processor. 

My /etc/conf.d/snmpd:

```
# Copyright 1999-2004 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/files/snmpd.conf,v 1.8 2006/11/26 21:37:22 cedk Exp $

# Initial (empty) options.

SNMPD_FLAGS=""

# Enable connection logging.

#SNMPD_FLAGS="${SNMPD_FLAGS} -a"

# Enable syslog and disable file log.

#SNMPD_FLAGS="${SNMPD_FLAGS} -Lsd -Lf /dev/null"

# Enable agentx socket as /var/agentx/master

# *NOTE* Before uncommenting this, make sure

#        the /var/agentx directory exists.

#SNMPD_FLAGS="${SNMPD_FLAGS} -x /var/agentx/master"
```

The directory '/etc/make.profile' links to '/usr/portage/profiles/default-linux/amd64/2007.0'.

Now I've got the same error voor my cpufreq daemon:

```
cpufreqd[6535]: segfault at 0000000000000000 rip 00002aaaab143c20 rsp 00007fffffffe118 error 4
```

I'm a little bit confused now    :Confused:  . . . 

Hopefully you, or maybe someone else, could help me with this problem to solve it. Thanks for all of your help anyway!

----------

## gerdesj

Sorry about the delay...

Could you post the output of "emerge --info" please. 

Cheers

Jon

----------

## gijsg03

Thanks for your reaction!

Here is my output of an 'emerge --info':

```

Portage 2.1.3.19 (default-linux/amd64/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.23-gentoo-r3 x86_64)

=================================================================

System uname: 2.6.23-gentoo-r3 x86_64 Intel(R) Core(TM)2 Duo CPU E6750 @ 2.66GHz

Timestamp of tree: Sun, 20 Jan 2008 20:46:01 +0000

app-shells/bash:     3.2_p17-r1

dev-lang/python:     2.4.4-r6

dev-python/pycrypto: 2.0.1-r6

sys-apps/baselayout: 1.12.10-r5

sys-apps/sandbox:    1.2.18.1-r2

sys-devel/autoconf:  2.13, 2.61-r1

sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.18-r1

sys-devel/gcc-config: 1.4.0-r4

sys-devel/libtool:   1.5.24

virtual/os-headers:  2.6.23-r2

ACCEPT_KEYWORDS="amd64"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O2 -march=nocona -fomit-frame-pointer -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/bind"

CONFIG_PROTECT_MASK="/etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"

CXXFLAGS="-O2 -march=nocona -fomit-frame-pointer -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="http://ftp.snt.utwente.nl/pub/os/linux/gentoo"

MAKEOPTS="-j3"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"

USE="X acl amd64 apache2 berkdb bitmap-fonts cdr cli cracklib crypt dba dri dvd fortran gd gdbm gnome gpm gtk hardened hardenedphp iconv innodb ipv6 isdnlog jpeg lm_sensors maildir midi mmx mudflap mysql ncurses nls nptl nptlonly openmp pam pcre perl php png pop3d pppd python qt3 qt4 readline reflection samba session slang snmp sockets spl sqlite sse sse2 ssl svg tcpd truetype truetype-fonts type1-fonts unicode vhosts xml xml2 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i810 mach64 mga neomagic nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

```

----------

## gijsg03

Hello,

I solved the problem   :Very Happy: . The solution for both problems (snmp-daemon and cpufreq-daemon) was to disable the 'USE' option "lm_sensors" in the file /etc/make.conf. How? The first option is to delete this option in the file /etc/make.conf. The second option is add the rule '<package> -lm_sensors' in the file /etc/portage/package.use. 

My suggestion for problems like "segfault at 0000000000000000 rip........." is:

- disable the rule "USE=.........." in the file '/etc/make.conf'

- run 'emerge -p <package>'

- see what USE-options are different

- enable the rule "USE=.........." in the file '/etc/make.conf'

- Disable the earlier found differences one-by-one in the /etc/portage/package.use file to find out which option conflicts.

Thanks for all the help!!!

----------

