Red Hat Bugzilla – Bug 801788
libguestfs holds open file descriptors when handle is launched
Last modified: 2012-06-20 03:01:15 EDT
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
Fixed upstream: https://github.com/libguestfs/libguestfs/commit/f1f045adf8d00549dd3efa3619e1162f9004b61e
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
(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?
(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.
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.
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