Please backport agent/mibgroup/host/hr_swrun.c to 5.4.1

Bug #517574 reported by Sergey Svishchev on 2010-02-05
48
This bug affects 7 people
Affects Status Importance Assigned to Milestone
net-snmp (Ubuntu)
Wishlist
Unassigned

Bug Description

There are two problems in snmpd 5.4.1~dfsg-12ubuntu7 (version currently in Karmic):

1) crash due to bad pointer dereference in hr_swrun.c:748. Kernel message looks like:

segfault at 1 ip 00007f984e0ee3e0 sp 00007fffe41e1270 error 4 in libnetsnmpmibs.so.15.1.0[7f984e0bd000+10d000]

2) hrSWRunPath may not be populated for all processes (/proc/.../status parsing is faulty)

Both problems are fixed in current code, but there's no 5.5 package yet.

Chuck Short (zulcss) wrote :

Is there any upstream bugs that are used to track these?

Changed in net-snmp (Ubuntu):
importance: Undecided → Wishlist
status: New → Incomplete
Sergey Svishchev (svs) wrote :
Chuck Short (zulcss) wrote :

Im going to close this as this is fixed in lucid. However, this is probably a good candidate for an SRU.

regards
chuck

Changed in net-snmp (Ubuntu):
assignee: nobody → Chuck Short (zulcss)
assignee: Chuck Short (zulcss) → nobody
status: Incomplete → Fix Released
assignee: nobody → Chuck Short (zulcss)
assignee: Chuck Short (zulcss) → nobody
Zach Wily (zach-zwily) wrote :

I don't think this is fixed in Lucid. Lucid has version 5.4.2.1, but I think the change was committed upstream after that. From the source code for the package included in Lucid:

            if ((fp = fopen(string, "r")) == NULL)
                return NULL;
            fgets(buf, sizeof(buf), fp); /* Name: process name */
            if ( cp == NULL ) {
                fclose(fp);
                return NULL; /* the process probably died */
            }

If you look at the change linked to by Sergey (#2), you can see that it's not applied. Also, the hrSWRunPath is still not available.

Agreed - hrSWRunPath is still unpopulated in Lucid w/ 5.4.2.1~dfsg0ubuntu1-0ubuntu2

Sergey Svishchev (svs) on 2010-07-29
Changed in net-snmp (Ubuntu):
status: Fix Released → Confirmed
Sergey Svishchev (svs) wrote :

I'd like to see this bug fixed in Lucid, it's affecting monitoring infrastructure that I use (false alarms like "no cron process present").

Sergey Svishchev (svs) wrote :

test case:

$ snmpbulkget -v 2c -c ... -Cr10 ... hrSWRunPath
HOST-RESOURCES-MIB::hrSWRunPath.1 = STRING: "/sbin/init"
HOST-RESOURCES-MIB::hrSWRunParameters.1 = ""
HOST-RESOURCES-MIB::hrSWRunParameters.2 = ""
HOST-RESOURCES-MIB::hrSWRunParameters.3 = ""
HOST-RESOURCES-MIB::hrSWRunParameters.4 = ""
HOST-RESOURCES-MIB::hrSWRunParameters.5 = ""
HOST-RESOURCES-MIB::hrSWRunParameters.6 = ""
HOST-RESOURCES-MIB::hrSWRunParameters.7 = ""
HOST-RESOURCES-MIB::hrSWRunParameters.8 = ""
HOST-RESOURCES-MIB::hrSWRunParameters.9 = ""

As you can see, hrSWRunPath table is truncated.

I have just come across this myself, and similarly it has broken our process monitoring of servers that are running Lucid.

Will we see the fix rolled out?

Sergey Svishchev (svs) wrote :
tags: added: patch
Sergey Svishchev (svs) wrote :

Maybe not...

pdf (pdffs) wrote :

A proposed solution is to simply backport hr_swrun.c from 5.4.4, tested and problem resolved here using this patch.

Sergey Svishchev (svs) on 2013-05-18
no longer affects: server-papercuts
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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