segfault and warnings from net-snmp 5.4.x

Bug #200614 reported by s0nic
58
This bug affects 4 people
Affects Status Importance Assigned to Milestone
net-snmp (Ubuntu)
Fix Released
Undecided
Unassigned
Hardy
Fix Released
Undecided
Chuck Short
Intrepid
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: snmpd

I have annoying warnings from the current snmp version for hardy (5.4.1~dfsg-4ubuntu2).
It has been fixed by the following patch http://sourceforge.net/tracker/index.php?func=detail&aid=1805971&group_id=12694&atid=456380

Note:

[ 1805971 ] 5.4.1 suppress annoying registration warnings on startup

Net-SNMP 5.4.x line

5.4.1 suppress annoying registration warnings on startup
The attached patch fixes the following annoying warnings

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

logged by the agent on startup for everyone.

This is the same patch as SVN Rev. 16669.

Revision history for this message
Marlon Dutra (mfdutra) wrote :

For me, it's not just a warning. Snmpd is dying almost every time I try to snmpget from it. I reached to the point to put init to respawn it.

snmpd[9799]: Connection from UDP: [127.0.0.1]:41246
init: snmp main process (9799) killed by SEGV signal
init: snmp main process ended, respawning
snmpd[9962]: netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()

I'm getting that nearly every 5 minutes, when MRTG gets the interfaces counters from my host.

It's running hardy, all updated, with snmd 5.4.1~dfsg-4ubuntu4.

Revision history for this message
Marlon Dutra (mfdutra) wrote :

Also, I get something in dmesg:

[84375.146553] snmpd[9962]: segfault at b7f73000 eip b7d59040 esp bfc03300 error 4
[84674.900973] snmpd[10307]: segfault at b7fac000 eip b7d92040 esp bfb6e8f0 error 4

Revision history for this message
Marlon Dutra (mfdutra) wrote :

I've found the origin of the problem.

It happens when I have more than one network interface with the same IP address. I got that problem in a server where I have proxy arp between two interfaces, and in one of them I had the same IP address, although with a 32-bit netmask. Since it's not mandatory to have IP address set in both interfaces for proxy arp, I just kept it in one of them. Snmpd works well now.

But I guess VPN servers that use multiple interfaces with the same IP address will face problem. I haven't tested it this way though.

Revision history for this message
Jason Harvey (jason-alioth) wrote :

This happens to me quite often, and I do not have a duplicate IP addresses.

Aug 31 22:48:07 neo snmpd[23051]: netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()
Aug 31 22:48:07 neo snmpd[23051]: netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()
Aug 31 22:48:07 neo snmpd[23051]: netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()
Aug 31 22:50:07 neo kernel: [353863.209591] snmpd[23051]: segfault at 7fab516a9000 rip 7fab51642d00 rsp 7fff5a2a02d8 error 4

snmpd Version: 5.4.1~dfsg-4ubuntu4
Running on Hardy.

Revision history for this message
Jason Harvey (jason-alioth) wrote :

Here is an strace up of the crash:

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fdd3fdbf000
read(8, "00000000000000000000000000000001"..., 1024) = 108
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 9
ioctl(9, SIOCGIFINDEX, {ifr_name="lo", ifr_index=1}) = 0
close(9) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 9
ioctl(9, SIOCGIFINDEX, {ifr_name="eth0", ifr_index=2}) = 0
close(9) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---

Looks like it definitely has something to do with the network interface processing. The previous poster mentioned that this problem occurred when he had one IP assigned to two network interfaces. I don't have any duplicate IPs, however I do have a virtual ethernet interface (eth0:1). Perhaps this is why it is dying?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package net-snmp - 5.4.1~dfsg-7.1ubuntu5

---------------
net-snmp (5.4.1~dfsg-7.1ubuntu5) intrepid; urgency=low

  * debian/snmpd.init: LSBify the snmpd.init script. And add status
    notification, based on inital patch by Gary Coady. (LP: #43575)
  * debian/patches/54_fix_registration_error.patch: Surpresses annoying
    registrations in startup. (LP: #200614)

 -- Chuck Short <email address hidden> Fri, 12 Sep 2008 13:21:40 -0400

Changed in net-snmp:
status: New → Fix Released
Revision history for this message
Alwin Garside (yogarine) wrote :

Is this fix also going into hardy-updates? I'd really like so, especially considering hardy is an LTS release.

Changed in net-snmp:
status: New → Confirmed
Revision history for this message
Chad Campling (chad-campling) wrote :

I would also like to see this fix in Hardy LTS

Changed in net-snmp:
assignee: nobody → ubuntu-server
Revision history for this message
Jason Harvey (jason-alioth) wrote :

I have attached a patch for the Hardy package which I took from the Intrepid patch 54_fix_registration_error.patch. So far, it appears to stop the registration messages and fix the segfault.

Revision history for this message
Jason Harvey (jason-alioth) wrote :

Created a debdiff for the previous patch I attached.

Revision history for this message
moojix (moojix) wrote :

me too, would be great to see this fix in Hardy.

Revision history for this message
Hassan El Jacifi (waver) wrote :

This bug still exist for Hardy (snmpd 5.4.1~dfsg-4ubuntu4.2)

Mar 3 16:00:37 xxx snmpd[15368]: netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()
Mar 3 16:00:37 xxx snmpd[15368]: netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()
Mar 3 16:00:37 xxx snmpd[15368]: netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()

Revision history for this message
Rafael M. (rmveras) wrote :

Jun 24 10:37:59 nix snmpd[4987]: Received TERM or STOP signal... shutting down...
Jun 24 10:38:05 nix snmpd[5007]: netsnmp_assert !"registration != duplicate" failed agent_registry.c:535 netsnmp_subtree_load()
Jun 24 10:38:05 nix snmpd[5007]: NET-SNMP version 5.4.1

Same version of Hassan, ubuntu 8.04 is realy LTS? I don't think so... :-)

Thierry Carrez (ttx)
Changed in net-snmp (Ubuntu Hardy):
assignee: Ubuntu Server Team (ubuntu-server) → Chuck Short (zulcss)
status: Confirmed → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted net-snmp into hardy-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in net-snmp (Ubuntu Hardy):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
A. Karl Kornel (akkornel) wrote :

I've installed the updated snmp, snmpd, libsnmp15, libsnmp-base, libsnmp-dev, and libsnmp-perl packages onto one of my Hardy servers. After an hour, things have been running OK, with no assertions or other weird log entries, although I do see one new log entry:

Sep 24 15:27:09 npbnagb snmptrapd[16645]: Warning: no access control information configured. This receiver will *NOT* accept any incoming notifications.

If everything continues to go OK I'll report back in 1 day, and then (if the package hasn't been released yet) in 1 week!

Revision history for this message
A. Karl Kornel (akkornel) wrote :

Hello! Well, with the weekend gone by, I'm happy to say that my SNMP daemon is still up and running!

Martin Pitt (pitti)
tags: added: verification-done
removed: verification-needed
Revision history for this message
A. Karl Kornel (akkornel) wrote :

Hello! Since it's been a week I'm reporting back. Everything is still working fine!

Revision history for this message
A. Karl Kornel (akkornel) wrote :

Hello, I'm back with some bad news...

On Saturday, snmpd segfaulted again. This was on the same machine which I had said was running OK after installing the hardy-proposed packages.

I re-started snmpd under gdb Saturday; it crashed again today, and here's the backtrace info from the crash.

Revision history for this message
Chuck Short (zulcss) wrote :

@ A. Karl Kornel

This looks like a different bug. Please open a new bug for it so we can keep a better handle on it.

Thanks
chuck

Revision history for this message
Paul Elliott (omahn) wrote :

I can also confirm that the SNMP packages in hardy-proposed resolve this issue for me.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package net-snmp - 5.4.1~dfsg-4ubuntu4.3

---------------
net-snmp (5.4.1~dfsg-4ubuntu4.3) hardy-proposed; urgency=low

  * debian/patches/101-fix-ipalias.patch: Fix flooding syslog -
    Syslog fills with hundreds of these errors if you have a network
    interface, e.g. eth2, with no IP address, but you have an alias,
    e.g. eth2:1, that does have an IP address (and netmask).
    (LP: #270713)
  * debian/patches/103-fix-ubuntu-lmsensors.patch: Point to the right
    place for /etc/sensors3.conf. (LP: #192745)
  * debian/patches/99-fix-perl-counter-in-subagent.patch: Fix for Counter64 in
    perl subagent. (LP: #406171)
  * debian/patches/53_fix_python_regression.patch: Fix python segmentation fault.
    (LP: #347361)
  * debian/patches/54_fix_registration_error.patch: Surpresses annoying
    registrations in startup. (LP: #200614)

 -- Chuck Short <email address hidden> Tue, 15 Sep 2009 14:13:51 -0400

Changed in net-snmp (Ubuntu Hardy):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.