Bug 801788 - libguestfs holds open file descriptors when handle is launched
libguestfs holds open file descriptors when handle is launched
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs (Show other bugs)
6.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Richard W.M. Jones
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-09 09:01 EST by Richard W.M. Jones
Modified: 2012-06-20 03:01 EDT (History)
5 users (show)

See Also:
Fixed In Version: libguestfs-1.16.10-1.el6
Doc Type: Bug Fix
Doc Text:
No Documentation needed.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 03:01:15 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Richard W.M. Jones 2012-03-09 09:01:32 EST
Description of problem:

I discovered a problem when a program is using libguestfs
and pipes.  The recovery process holds file descriptors open
(it doesn't exec, so is not affected by FD_CLOEXEC).  For
pipes this is very bad because you cannot close the write
side of the pipe, since the recovery process holds it open.

First version of proposed patch is here, but danpb pointed
out that it's also a good idea to remove signal handlers as
well, so I'm going to do a second version.

https://www.redhat.com/archives/libguestfs/2012-March/msg00044.html

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

1.17.13

How reproducible:

100%

Steps to Reproduce:

I need to write a simple reproducer, but the problem was exposed
initially when I wrote this program:

https://www.redhat.com/archives/libguestfs/2012-March/msg00045.html
Comment 4 Qixiang Wan 2012-03-23 05:56:06 EDT
Hi Rich,

I tried to reproduce this with the program "copy_over" you mentioned in the bug description, but I got same error for the old package and the latest one. Is it
different error from this defect or the defect hasn't been fixed?

Old package:
# rpm -q libguestfs
libguestfs-1.16.8-1.el6.x86_64
# ./copy_over rhel /root/file.test rhel6 /root
libguestfs: error: file receive cancelled by daemon
libguestfs: error: /dev/fd/5: error in chunked encoding

New package:
# rpm -q libguestfs
libguestfs-1.16.10-1.el6.x86_64
# ./copy_over rhel /root/file.test rhel6 /root
libguestfs: error: file receive cancelled by daemon
libguestfs: error: /dev/fd/5: error in chunked encoding
Comment 5 Richard W.M. Jones 2012-03-23 06:03:43 EDT
(In reply to comment #4)
> Hi Rich,
> 
> I tried to reproduce this with the program "copy_over" you mentioned in the bug
> description, but I got same error for the old package and the latest one. Is it
> different error from this defect or the defect hasn't been fixed?
> 
> Old package:
> # rpm -q libguestfs
> libguestfs-1.16.8-1.el6.x86_64
> # ./copy_over rhel /root/file.test rhel6 /root
> libguestfs: error: file receive cancelled by daemon
> libguestfs: error: /dev/fd/5: error in chunked encoding
> 
> New package:
> # rpm -q libguestfs
> libguestfs-1.16.10-1.el6.x86_64
> # ./copy_over rhel /root/file.test rhel6 /root
> libguestfs: error: file receive cancelled by daemon
> libguestfs: error: /dev/fd/5: error in chunked encoding

This error is not the one you would expect from this bug.

If you have this bug, then the test will *hang*.

The error you're seeing is, oh joy, a different one.  Can
you run it again with:

  LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1 ./copy_over [etc]

and then post the full debug output into a NEW bug?
Comment 6 Qixiang Wan 2012-03-23 06:19:19 EDT
(In reply to comment #5)
> This error is not the one you would expect from this bug.
> 
> If you have this bug, then the test will *hang*.
> 
> The error you're seeing is, oh joy, a different one.  Can
> you run it again with:
> 
>   LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1 ./copy_over [etc]
> 
> and then post the full debug output into a NEW bug?

Thanks, checked the debug output, I find it happened because the src was a file, and it should be a directory. So it's not a bug.

And I reproduced the hang with correct command line, with the new package (libguestfs-1.16.10-1.el6), the copy can finish without issue:

# ./copy_over rhel /root/ rhel6 /tmp
copy finished, elapsed time (excluding launch) was 0.498 s

So change this to VERIFIED.
Comment 7 Richard W.M. Jones 2012-04-26 09:45:46 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No Documentation needed.
Comment 9 errata-xmlrpc 2012-06-20 03:01:15 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0774.html

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