Bug 519378 - kvm forgets to close /proc/meminfo when hugepages are active
Summary: kvm forgets to close /proc/meminfo when hugepages are active
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: qemu
Version: 11
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Glauber Costa
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F11VirtTarget
TreeView+ depends on / blocked
 
Reported: 2009-08-26 12:04 UTC by Daniel Berrangé
Modified: 2009-09-11 23:38 UTC (History)
7 users (show)

Fixed In Version: 0.10.6-4.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-11 23:38:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Daniel Berrangé 2009-08-26 12:04:54 UTC
Description of problem:

look at a running QEMU instance which has the --mem-path arg set, and it'll have an open handle to /proc/meminfo

# lsof -p `pgrep qemu-kvm` | grep proc
qemu-kvm 6667 qemu    7r   REG        0,3          0 4026531986 /proc/meminfo


The flaw is obvious in vl.c

   static int gethugepagesize(void)

THis method opens /proc/meminfo, but leaks the FD never bothering to close it


Version-Release number of selected component (if applicable):
qemu-0.10.6-1.fc11.i586

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Mark McLoughlin 2009-09-04 10:11:34 UTC
I backported this commit to fix it:

  http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=commitdiff;h=f1ac0931a1

* Fri Sep  4 2009 Mark McLoughlin <markmc> - 2:0.10.6-3
- Use statfs to determine huge page size, fixing fd leak (#519378)

Comment 2 Fedora Update System 2009-09-04 11:19:13 UTC
qemu-0.10.6-4.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/qemu-0.10.6-4.fc11

Comment 3 Fedora Update System 2009-09-06 20:46:27 UTC
qemu-0.10.6-4.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update qemu'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-9377

Comment 4 Fedora Update System 2009-09-11 23:37:45 UTC
qemu-0.10.6-4.fc11 has been pushed to the Fedora 11 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.