Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 676788 - libguestfs trace segfaults when list-filesystems returns error
libguestfs trace segfaults when list-filesystems returns error
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs (Show other bugs)
6.1
Unspecified Linux
medium Severity medium
: rc
: ---
Assigned To: Richard W.M. Jones
Virtualization Bugs
:
Depends On:
Blocks: 682756
  Show dependency treegraph
 
Reported: 2011-02-11 04:08 EST by Lei Wang
Modified: 2015-09-27 22:02 EDT (History)
3 users (show)

See Also:
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.
Story Points: ---
Clone Of:
: 682756 (view as bug list)
Environment:
Last Closed: 2011-05-19 07:44:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0586 normal SHIPPED_LIVE Low: libguestfs security, bug fix, and enhancement update 2011-05-19 07:44:03 EDT

  None (edit)
Description Lei Wang 2011-02-11 04:08:22 EST
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 08:51:20 EST
Since this bug exists upstream too, I have cloned it as
bug 682756.
Comment 3 Richard W.M. Jones 2011-03-07 09:00:17 EST
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 12:42:44 EST
http://brewweb.devel.redhat.com/brew/taskinfo?taskID=3159967
(still building)
Comment 5 Richard W.M. Jones 2011-03-07 16:34:23 EST
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-07 20:28:02 EST
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 01:10:18 EST

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 01:33:24 EDT
    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 03:53:15 EDT
This is fine.
Comment 13 errata-xmlrpc 2011-05-19 07:44:48 EDT
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 09:10:57 EDT
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.