Bug 864504 - smem falls over in the presence of unknown UIDs, which is a problem when using LXC.
Summary: smem falls over in the presence of unknown UIDs, which is a problem when usin...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: smem
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Matthew Miller
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-09 13:22 UTC by Lars Kellogg-Stedman
Modified: 2012-12-11 01:33 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-11 01:33:33 UTC
Type: Bug
Embargoed:


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

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.


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