RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 676788 - libguestfs trace segfaults when list-filesystems returns error
Summary: libguestfs trace segfaults when list-filesystems returns error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs
Version: 6.1
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 682756
TreeView+ depends on / blocked
 
Reported: 2011-02-11 09:08 UTC by Lei Wang
Modified: 2015-09-28 02:02 UTC (History)
3 users (show)

Fixed In Version: libguestfs-1.7.17-15.el6
Doc Type: Bug Fix
Doc Text:
The guestfish set-trace command was not prepared to handle all possible error conditions. This resulted in a segmentation fault when attempting to handle several conditions. The command now handles trace errors separately, so the segmentation fault no longer occurs. Note that this bug was reported and corrected during development. It was not seen in production systems in the field.
Clone Of:
: 682756 (view as bug list)
Environment:
Last Closed: 2011-05-19 11:44:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0586 0 normal SHIPPED_LIVE Low: libguestfs security, bug fix, and enhancement update 2011-05-19 11:44:03 UTC

Description Lei Wang 2011-02-11 09:08:22 UTC
Description of problem:
Run "guestfish --remote" commands "set-trace 1" and "list-filesystems" before "run" or "add" command will lead to error "guestfish: remote: looks like the server is not running".

Version-Release number of selected component (if applicable):
libguestfs-1.7.17-12.el6

How reproducible:
100%

Steps to Reproduce:
1. # eval `guestfish --listen`
2. # guestfish --remote -- -add /data/images/RHEL-Server-5.5-32-hvm.raw
3. # guestfish --remote -- -set-trace 1
4. # guestfish --remote -- -list-filesystems
libguestfs: trace: list_filesystems
libguestfs: trace: list_devices
libguestfs: error: list_devices: call launch before using this function
(in guestfish, don't forget to use the 'run' command)
libguestfs: trace: list_devices = NULL (error)
libguestfs: trace: list_filesystems = ["guestfish: protocol error: could not decode reply from server
5. # guestfish --remote -- -run
guestfish: remote: looks like the server is not running

Actual results:
guestfish remote server down after reporting error, "guestfish --listen" process lost.
In guestfish interactive shell there's no similar problem, shell still work after reporting error.

Expected results:
guestfish remote server should still be alive after reporting error.

Additional info:
1. if no "set-trace" command executed before "list-filesystems", guestfish server doesn't down.
2. if execute "run" command before "list-filesystems", guestfish server doesn't down.

Comment 2 Richard W.M. Jones 2011-03-07 13:51:20 UTC
Since this bug exists upstream too, I have cloned it as
bug 682756.

Comment 3 Richard W.M. Jones 2011-03-07 14:00:17 UTC
This is nothing to do with remote, and all to
do with the trace patch.  Simple reproducer:

$ guestfish -a /dev/null -x list-filesystems
libguestfs: trace: add_drive_opts "/dev/null"
libguestfs: trace: add_drive_opts = 0
libguestfs: trace: list_filesystems
libguestfs: trace: list_devices
libguestfs: error: list_devices: call launch before using this function
(in guestfish, don't forget to use the 'run' command)
libguestfs: trace: list_devices = NULL (error)
libguestfs: trace: list_filesystems = ["Segmentation fault (core dumped)

Comment 4 Richard W.M. Jones 2011-03-07 17:42:44 UTC
http://brewweb.devel.redhat.com/brew/taskinfo?taskID=3159967
(still building)

Comment 5 Richard W.M. Jones 2011-03-07 21:34:23 UTC
I can't work out how to make any changes to the
erratum (https://errata.devel.redhat.com/errata/info/10513)
but this issue is surely serious enough that it should
stop us from going ahead and releasing the current
(1.7.17-14) package.

Comment 6 Yewei Shao 2011-03-08 01:28:02 UTC
rjones, I have changed the errata status to NEW_FILES, you can add this bug and new libguestfs version now.

Thanks,
Maggie.

Comment 7 Jinxin Zheng 2011-03-08 06:10:18 UTC

Test result for libguestfs-1.7.17-14.el6:

$ guestfish -a /dev/null -x list-filesystems
libguestfs: trace: add_drive_opts "/dev/null"
libguestfs: trace: add_drive_opts = 0
libguestfs: trace: list_filesystems
libguestfs: trace: list_devices
libguestfs: error: list_devices: call launch before using this function
(in guestfish, don't forget to use the 'run' command)
libguestfs: trace: list_devices = NULL (error)
libguestfs: trace: list_filesystems = ["Segmentation fault (core dumped)

result for libguestfs-1.7.17-15.el6:

$ guestfish -a /dev/null -x list-filesystems
libguestfs: trace: add_drive_opts "/dev/null"
libguestfs: trace: add_drive_opts = 0
libguestfs: trace: list_filesystems
libguestfs: trace: list_devices
libguestfs: error: list_devices: call launch before using this function
(in guestfish, don't forget to use the 'run' command)
libguestfs: trace: list_devices = NULL (error)
libguestfs: trace: list_filesystems = NULL (error)

see there no seg fault after upgrading.

I also tested the reproducer in Lei's description, results are similar to this test. I'm putting this VERIFIED.

Comment 11 Laura Bailey 2011-04-20 05:33:24 UTC
    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:
The guestfish set-trace command was not prepared to handle all possible error conditions. This resulted in a segmentation fault when attempting to handle several conditions. The command now handles trace errors separately, so the segmentation fault no longer occurs.

Note that this bug was reported and corrected during development. It was not seen in production systems in the field.

Comment 12 Richard W.M. Jones 2011-04-20 07:53:15 UTC
This is fine.

Comment 13 errata-xmlrpc 2011-05-19 11:44:48 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0586.html

Comment 14 errata-xmlrpc 2011-05-19 13:10:57 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0586.html


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