Bug 864504 - smem falls over in the presence of unknown UIDs, which is a problem when using LXC.
smem falls over in the presence of unknown UIDs, which is a problem when usin...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: smem (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Matthew Miller
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-09 09:22 EDT by Lars Kellogg-Stedman
Modified: 2012-12-10 20:33 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-10 20:33:33 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Allow smem to operate in the presence of unknown UIDs (508 bytes, patch)
2012-10-09 09:22 EDT, Lars Kellogg-Stedman
no flags Details | Diff

  None (edit)
Description Lars Kellogg-Stedman 2012-10-09 09:22:46 EDT
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 16:24:04 EDT
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 16:36:08 EDT
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 16:15:47 EDT
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-10 20:33:34 EST
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.

Note You need to log in before you can comment on or make changes to this bug.