Bug 589039 - guestfish read-file cmd will cause daemon hang when read large files
Summary: guestfish read-file cmd will cause daemon hang when read large files
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-05 08:09 UTC by Pengzhen Cao
Modified: 2010-05-21 11:33 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-05-12 12:29:22 UTC
Embargoed:


Attachments (Terms of Use)

Description Pengzhen Cao 2010-05-05 08:09:27 UTC
Description of problem:
guestfsd will hang when using read-file to read a file large than 4MB

Version-Release number of selected component (if applicable):
libguestfs-1.2.3-1.fc12.6.x86_64, 
latest git version 1.3.9

How reproducible:
100%

Steps to Reproduce:
1. run guestfish, add an image, run and mount the filesystem
2. run read-file /path_to_large_file

  
Actual results:
guestfsd saying "file too large error" and hang, return "check_for_daemon_cancellation_or_eof" error to all following commands

Expected results:
guestfsd should not hang

Additional info:
There is no such issue with cat/more cmds, they will give file too large error only.

logs:
[pcao@pcao-test libguestfs-test]$ guestfish -a file_dir.ext3.raw.old 

Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: 'help' for help with commands
      'quit' to quit the shell

><fs> run
><fs> set-trace 1
><fs> set-verbose 1
set_verbose true
><fs> mount-options noatime /dev/vol_test/vol_file /
mount_options "noatime" "/dev/vol_test/vol_file" "/"
send_to_daemon: 0x1b138f0 g->state = 3, n = 76
recv_from_daemon: 0x1b138f0 g->state = 3, size_rtn = 0x7fff80eb475c, buf_rtn = 0x7fff80eb4750
[   47.850642] kjournald starting.  Commit interval 5 seconds
[   47.853288] EXT3 FS on dm-1, internal journal
[   47.855138] EXT3-fs: recovery complete.
[   47.856600] EXT3-fs: mounted filesystem with ordered data mode.
><fs> ping-daemon 
ping_daemon
send_to_daemon: 0x1b138f0 g->state = 3, n = 28
recv_from_daemon: 0x1b138f0 g->state = 3, size_rtn = 0x7fff80eb477c, buf_rtn = 0x7fff80eb4770
><fs> read-file /file_ops/file_ascii_long
read_file "/file_ops/file_ascii_long"
send_to_daemon: 0x1b138f0 g->state = 3, n = 60
recv_from_daemon: 0x1b138f0 g->state = 3, size_rtn = 0x7fff80eb472c, buf_rtn = 0x7fff80eb4720
guestfsd: error: /file_ops/file_ascii_long: file is too large for the protocol, use guestfs_download instead
guestfsd: error: guestfsd: failed to encode reply body
(mlibguestfs: error: read_file: /file_ops/file_ascii_long: file is too large for the protocol, use guestfs_download instead
><fs> ping-daemon 
ping_daemon
send_to_daemon: 0x1b138f0 g->state = 3, n = 28
aybe the reply exceeds the maximum message size in the protocol?)
check_for_daemon_cancellation_or_eof: 0x1b138f0 g->state = 3, fd = 4
libguestfs: error: check_for_daemon_cancellation_or_eof: read 0x88 from daemon, expected 0xffffeeee

><fs> ll /
ll "/"
send_to_daemon: 0x1b138f0 g->state = 3, n = 36
check_for_daemon_cancellation_or_eof: 0x1b138f0 g->state = 3, fd = 4
libguestfs: error: check_for_daemon_cancellation_or_eof: read 0x2000f5f5 from daemon, expected 0xffffeeee


><fs> q

closing guestfs handle 0x1b138f0 (state 2)
umount_all
send_to_daemon: 0x1b138f0 g->state = 3, n = 28
check_for_daemon_cancellation_or_eof: 0x1b138f0 g->state = 3, fd = 4
libguestfs: error: check_for_daemon_cancellation_or_eof: read 0x96 from daemon, expected 0xffffeeee

sync
send_to_daemon: 0x1b138f0 g->state = 3, n = 28
check_for_daemon_cancellation_or_eof: 0x1b138f0 g->state = 3, fd = 4
libguestfs: error: check_for_daemon_cancellation_or_eof: read 0x1 from daemon, expected 0xffffeeee

kill_subprocess
sending SIGTERM to process 24740

Comment 1 Richard W.M. Jones 2010-05-07 12:35:42 UTC
Patch posted upstream:
https://www.redhat.com/archives/libguestfs/2010-May/msg00030.html

Comment 3 Fedora Update System 2010-05-14 19:12:56 UTC
libguestfs-1.2.6-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/libguestfs-1.2.6-1.fc13

Comment 4 Fedora Update System 2010-05-17 12:28:11 UTC
libguestfs-1.2.7-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/libguestfs-1.2.7-1.fc12

Comment 5 Fedora Update System 2010-05-17 12:47:58 UTC
libguestfs-1.2.7-1.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/libguestfs-1.2.7-1.el5

Comment 6 Fedora Update System 2010-05-17 13:00:07 UTC
libguestfs-1.2.7-2.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/libguestfs-1.2.7-2.fc13

Comment 7 Fedora Update System 2010-05-21 11:33:18 UTC
libguestfs-1.2.7-2.fc13.1 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/libguestfs-1.2.7-2.fc13.1


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