Bug 864504

Summary: smem falls over in the presence of unknown UIDs, which is a problem when using LXC.
Product: [Fedora] Fedora Reporter: Lars Kellogg-Stedman <lars>
Component: smemAssignee: Matthew Miller <mattdm>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: mattdm, mschmidt
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-11 01:33:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Allow smem to operate in the presence of unknown UIDs none

Description Lars Kellogg-Stedman 2012-10-09 13:22:46 UTC
Created attachment 624102 [details]
Allow smem to operate in the presence of unknown UIDs

Description of problem:

smem throws a KeyError exception if it encounters unknown user ids in the process table:

Traceback (most recent call last):
  File "/bin/smem", line 656, in <module>
    showusers()
  File "/bin/smem", line 396, in showusers
    showtable(pt.keys(), fields, columns.split(), options.sort or 'pss')
  File "/bin/smem", line 476, in showtable
    r = [fields[c][1](n) for c in columns]
  File "/bin/smem", line 375, in showuser
    return src.username(u)
  File "/bin/smem", line 63, in username
    self._ucache[uid] = pwd.getpwuid(uid)[0]
KeyError: 'getpwuid(): uid not found: 26'

While this is a rare situation on a legacy server, it is very common on a system using some sort of container-based virtualization such as LXC, where per-process namespaces mean that there's no guarantee that running processes are sharing the same source of user information.

Version-Release number of selected component (if applicable):

smem-1.0-3.fc17.noarch

Additional information:

The attached patch addresses this problem by generating a name for unknown UIDs of the form "unknown_<uid>" (e.g., "unknown_26").

Comment 1 Fedora Update System 2012-10-29 20:24:04 UTC
smem-1.2-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/smem-1.2-1.fc18

Comment 2 Fedora Update System 2012-10-29 20:36:08 UTC
smem-1.2-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/smem-1.2-1.fc17

Comment 3 Fedora Update System 2012-10-30 20:15:47 UTC
Package smem-1.2-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing smem-1.2-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-17255/smem-1.2-1.fc18
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2012-12-11 01:33:34 UTC
smem-1.2-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.