Bug 519378

Summary: kvm forgets to close /proc/meminfo when hugepages are active
Product: [Fedora] Fedora Reporter: Daniel BerrangĂ© <berrange>
Component: qemuAssignee: Glauber Costa <gcosta>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 11CC: berrange, dwmw2, gcosta, itamar, jaswinder, markmc, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.10.6-4.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-11 23:38:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 480594    

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.