Bug 588658 - some guestfish cmds give improper error message when exceeding internal buffer size
some guestfish cmds give improper error message when exceeding internal buffe...
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-04 04:36 EDT by Pengzhen Cao
Modified: 2013-06-04 14:05 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-12 12:32:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Pengzhen Cao 2010-05-04 04:36:53 EDT
Description of problem:
some guestfish cmds, (like strings, hexdump, strings-e, head-n, tail-n), does not give proper error message when the return msg exceed internal XDR buffer size.

Version-Release number of selected component (if applicable):
libguestfs-1.0.85-1.fc12.3.x86_64


How reproducible:
100%

Steps to Reproduce:
1. run guestfish, add a image, run , mount it
2. run hexdump  /your_file, whre "your_file" is a file larger than 900KB or so.
Or head-n 100000 /long_file

  
Actual results:
error msg:" libguestfs: error: hexdump: guestfsd: failed to encode reply body : Success"

Expected results:
Should be error msg say "file too large" or "exceed buffer limit" etc ,just like "more/cat" cmd

Additional info:
Comment 1 Richard W.M. Jones 2010-05-12 12:32:13 EDT
This is fixed in the latest upstream version of libguestfs:

$ guestfish -N fs -m /dev/sda1
><fs> fill-pattern abcdefg 10000000 /test
><fs> strings /test
libguestfs: error: strings: guestfsd: failed to encode reply body
(maybe the reply exceeds the maximum message size in the protocol?)
><fs> hexdump /test
libguestfs: error: hexdump: guestfsd: failed to encode reply body
(maybe the reply exceeds the maximum message size in the protocol?)
><fs> head /test
libguestfs: error: head: guestfsd: failed to encode reply body
(maybe the reply exceeds the maximum message size in the protocol?)
Comment 2 Richard W.M. Jones 2013-06-03 06:02:36 EDT
Note that 'hexdump -C' compresses repeated patterns.

So to reproduce this, use 'fill-pattern' with a pattern
length that doesn't divide 16.  For example a pattern length
of 2 gives:

><fs> fill-pattern "\xfe\xfd" 900K /foo
><fs> hexdump /foo 
00000000  fe fd fe fd fe fd fe fd  fe fd fe fd fe fd fe fd  |................|
*
000e1000

but a pattern length of 3 (3 does not divide 16) gives:

><fs> fill-pattern "\xfe\xfd\xfc" 900K /foo
><fs> hexdump /foo 
libguestfs: error: hexdump: guestfsd: failed to encode reply body
(maybe the reply exceeds the maximum message size in the protocol?)

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