Bug 519378

Summary: kvm forgets to close /proc/meminfo when hugepages are active
Product: [Fedora] Fedora Reporter: Daniel Berrange <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 19:38:11 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 480594    

Description Daniel Berrange 2009-08-26 08:04:54 EDT
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 06:11:34 EDT
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@redhat.com> - 2:0.10.6-3
- Use statfs to determine huge page size, fixing fd leak (#519378)
Comment 2 Fedora Update System 2009-09-04 07:19:13 EDT
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 16:46:27 EDT
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 19:37:45 EDT
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.