Bug 729887

Summary: appliance crashes running aug_init with flags=4
Product: Red Hat Enterprise Linux 6 Reporter: Jinxin Zheng <jzheng>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 6.2CC: leiwang, lutter, qwan
Target Milestone: rc   
Target Release: 6.2   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: libguestfs-1.7.17-26.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 10:31:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
verbose output none

Description Jinxin Zheng 2011-08-11 06:59:08 UTC
Created attachment 517744 [details]
verbose output

Description of problem:
run aug_init with flags=4 (AUG_TYPE_CHECK), the appliance crashes.

Version-Release number of selected component (if applicable):
libguestfs-1.7.17-24.el6.x86_64
augeas-0.9.0-1.el6.x86_64

How reproducible:
always

Steps to Reproduce:
$ guestfish -a test.img
><fs> run
><fs> mount /dev/sda1 /
><fs> aug-init / 4
libguestfs: error: unexpected end of file when reading from daemon.
This usually means the libguestfs appliance failed to start up.  Please
enable debugging (LIBGUESTFS_DEBUG=1) and rerun the command, then look at
the debug messages output prior to this error.
Or you can run 'libguestfs-test-tool' and post the complete output into
a bug report or message to the libguestfs mailing list.

Additional Info:
I downgraded augeas to 0.7.2-6, then the problem went away. But I don't know if this has to do with libguestfs, or is purely augeas problem.

Comment 1 Richard W.M. Jones 2011-08-11 07:38:13 UTC
The problem is that Augeas runs out of memory.  If you do:

LIBGUESTFS_MEMSIZE=2048 guestfish --ro -a /dev/vg_pin/F14x64 -i

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

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

Operating system: Fedora release 14 (Laughlin)
/dev/vg_f13x64/lv_root mounted on /
/dev/vda1 mounted on /boot

><fs> aug-init / 4
><fs> 

then that's enough memory for this to work OK.  It's not
really clear if this is a bug in libguestfs, Augeas, or
neither.

We don't want to increase the default amount of memory
given to the appliance for this one case.

Comment 2 David Lutterkort 2011-08-11 17:13:34 UTC
Yes, type checking is very memory intensive; it is also only needed during lens development. Typically, it is used only when running augparse.

There is absolutely no point in running aug_init with AUG_TYPE_CHECK turned on in a production/normal use setting as it is here.

I recommend closing this as NOTABUG, and modifying the test plan accordingly.

Comment 3 Richard W.M. Jones 2011-08-11 17:49:41 UTC
(In reply to comment #2)
> Yes, type checking is very memory intensive; it is also only needed during lens
> development. Typically, it is used only when running augparse.
> 
> There is absolutely no point in running aug_init with AUG_TYPE_CHECK turned on
> in a production/normal use setting as it is here.
> 
> I recommend closing this as NOTABUG, and modifying the test plan accordingly.

David, do you think we should filter out this option
in libguestfs, or do you think there might be a case
where someone using Augeas via libguestfs would use this
option?  (eg. We do allow people to upload their own
lenses)

Comment 4 David Lutterkort 2011-08-11 18:16:02 UTC
Filtering it out might be a little harsh in case somebody knows what they are doing and really needs it.

How about printing a warning "Setting the AUG_TYPE_CHECK flag is only needed when you do lens development and uses a lot of memory. The increased memory needs may lead to a crash of libguestfs" (or sth along these lines)

Comment 8 Richard W.M. Jones 2011-08-12 10:19:43 UTC
I changed the documentation:

http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=7739d7f471f9575828bd32489695d92dde005a9c

Comment 9 David Lutterkort 2011-08-12 16:56:36 UTC
The doc change looks perfect to me.

Comment 13 Jinxin Zheng 2011-08-23 09:25:41 UTC
Verified in libguestfs-1.7.17-26 there's document for the 'AUG_TYPE_CHECK':

$ guestfish help aug_init
...

    "AUG_TYPE_CHECK" = 4
        Typecheck lenses.

        This option is only useful when debugging Augeas lenses. Use of this
        option may require additional memory for the libguestfs appliance.
        You may need to set the "LIBGUESTFS_MEMSIZE" environment variable or
        call "set_memsize".

Comment 14 errata-xmlrpc 2011-12-06 10:31:57 UTC
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/RHBA-2011-1512.html