Bug 745761 - screenshot leaks pipe fd
Summary: screenshot leaks pipe fd
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Eric Blake
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 746075
TreeView+ depends on / blocked
 
Reported: 2011-10-13 10:30 UTC by Marc-Andre Lureau
Modified: 2011-10-13 20:13 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
: 746075 (view as bug list)
Environment:
Last Closed: 2011-10-13 20:13:06 UTC
Embargoed:


Attachments (Terms of Use)

Description Marc-Andre Lureau 2011-10-13 10:30:36 UTC
Description of problem:

It seems the screenshot API leaks FDs.

Version-Release number of selected component (if applicable):

v0.9.6-139-g9bc9999 (current git master)

How reproducible:

10/10

Steps to Reproduce:
1. lsof -p `pidof libvirtd`
2. virsh screenshot a-running-vm
3. lsof -p `pidof libvirtd`
  
Actual results:

The number of open files grows, and a new pipe fd is leaked.

Expected results:

The number of open files should remain constant after taking screenshots.

Comment 1 Marc-Andre Lureau 2011-10-13 11:24:04 UTC
It seems *errfd = pipeerr[0]; in command.c is not closed.

Comment 2 Marc-Andre Lureau 2011-10-13 11:45:16 UTC
I'll send a patch to libvirt ML.

Comment 3 Eric Blake 2011-10-13 20:13:06 UTC
0.9.7 will include:

commit 72851bb9ef0a6aef20141d0a13c36e5a1907a43a
Author: Marc-André Lureau <marcandre.lureau>
Date:   Thu Oct 13 13:47:58 2011 +0200

    virFDStream: close also given errfd (fd leak)
    
    In virFDStreamOpenFileInternal(), a errfd pipe is opened by
    virCommandRunAsync() and given to virFDStreamOpenInternal().
    
    It seems virFDStream should close errfd, just like the other
    fd it is given.
    
    This fixes screenshots leaking FDs:
    http://bugzilla.redhat.com/show_bug.cgi?id=745761


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