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 1196552 - virt-viewer --attach makes it crash
Summary: virt-viewer --attach makes it crash
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-viewer
Version: 7.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 7.2
Assignee: Virt Viewer Maint
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1181288
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-26 09:25 UTC by tingting zheng
Modified: 2015-11-19 07:36 UTC (History)
8 users (show)

Fixed In Version: virt-viewer-2.0-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 07:36:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2211 0 normal SHIPPED_LIVE virt-viewer, spice-gtk, and libgovirt bug fix and enhancement update 2015-11-19 08:27:40 UTC

Description tingting zheng 2015-02-26 09:25:50 UTC
Description of problem:
virt-viewer --attach option makes it crash 

Version-Release number of selected component (if applicable):
virt-viewer-0.6.0-12.el7.x86_64


How reproducible:
100%.

Steps to Reproduce:
1.Check virt-viewer manual,it says --attach option works for TCP/UNIX connection,from bug 999291#comment 18,it says --attach only has effect when using a UNIX socket connection.

# man virt-viewer
       -a, --attach
           Instead of making a direct TCP/UNIX socket connection to the remote display, ask libvirt to provide
           a pre-connected socket for the display. This avoids the need to authenticate with the remote display
           server directly. This option will only work when connecting to a guest that is running on the same
           host as the virt-viewer program. If attaching to the guest via libvirt fails, virt-viewer will
           automatically fallback to trying a regular direct TCP/UNIX socket connection.

2.Tried unix connnection by the below steps:
add auth_unix_rw="sasl" in the /etc/libvirt/libvirtd.conf

add sasl user
# saslpasswd2 -a libvirt test
(input your passwd)

Restart libvirtd server.
# service libvirtd restart

Prepare a running guest.
# virsh -c qemu+unix:///system list 
Please enter your authentication name: test
Please enter your password: 
 Id    Name                           State
----------------------------------------------------
 2     demo                           running

3.Test virt-viewer --attach option for UNIX connection:
3.1,virt-viewer to launch guest via UNIX connection without --attach.
# virt-viewer -c qemu+unix:///system demo --debug  -->No password needed,guest console will be launched successfully,and direct TCP connection shows in debug info.

(virt-viewer:21954): virt-viewer-DEBUG: fullscreen display 0: 0
(virt-viewer:21954): virt-viewer-DEBUG: connecting ...
(virt-viewer:21954): virt-viewer-DEBUG: Opening connection to libvirt with URI qemu+unix:///system
(virt-viewer:21954): virt-viewer-DEBUG: Add handle 8 1 0x26339e0
(virt-viewer:21954): virt-viewer-DEBUG: initial connect
(virt-viewer:21954): virt-viewer-DEBUG: notebook show status 0x2537180
(virt-viewer:21954): virt-viewer-DEBUG: virt_viewer_app_set_uuid_string: UUID changed to bf6d8713-b158-4bf2-beeb-eebb5cad1f89
(virt-viewer:21954): virt-viewer-DEBUG: No guest-specific fullscreen config, using fallback
(virt-viewer:21954): virt-viewer-DEBUG: notebook show status 0x2537180
(virt-viewer:21954): virt-viewer-DEBUG: Guest demo is running, determining display
(virt-viewer:21954): virt-viewer-DEBUG: Set connect info: (null),(null),(null),-1,(null),(null),(null),0
(virt-viewer:21954): virt-viewer-DEBUG: Guest demo has a spice display
(virt-viewer:21954): virt-viewer-DEBUG: Guest graphics address is 127.0.0.1:5900
(virt-viewer:21954): virt-viewer-DEBUG: Set connect info: localhost,127.0.0.1,5900,-1,unix,(null),(null),0
(virt-viewer:21954): virt-viewer-DEBUG: Error operation forbidden: read only access prevents virDomainOpenGraphics
(virt-viewer:21954): virt-viewer-DEBUG: After open connection callback fd=-1
(virt-viewer:21954): virt-viewer-DEBUG: Opening direct TCP connection to display at 127.0.0.1:5900:-1
(virt-viewer:21954): virt-viewer-DEBUG: New spice channel 0x265c030 SpiceMainChannel 0
(virt-viewer:21954): virt-viewer-DEBUG: notebook show status 0x2537180
(virt-viewer:21954): virt-viewer-DEBUG: Add timeout 0x265cd80 -1 0x7f324c85fa30 0x2636b00 1
(virt-viewer:21954): virt-viewer-DEBUG: main channel: opened
(virt-viewer:21954): virt-viewer-DEBUG: notebook show status 0x2537180
(virt-viewer:21954): virt-viewer-DEBUG: virt_viewer_app_set_uuid_string: UUID changed to bf6d8713-b158-4bf2-beeb-eebb5cad1f89

3.2 virt-viewer to launch guest via UNIX connection with --attach.
# virt-viewer -c qemu+unix:///system demo -a -->authtication box pop out,after input the user/password,virt-viewer coredump.

# virt-viewer -c qemu+unix:///system demo --attach --debug
(virt-viewer:21973): virt-viewer-DEBUG: fullscreen display 0: 0
(virt-viewer:21973): virt-viewer-DEBUG: connecting ...
(virt-viewer:21973): virt-viewer-DEBUG: Opening connection to libvirt with URI qemu+unix:///system
(virt-viewer:21973): virt-viewer-DEBUG: Add handle 8 1 0x276da40
(virt-viewer:21973): virt-viewer-DEBUG: Got libvirt credential request for 2 credential(s)
(virt-viewer:21973): virt-viewer-DEBUG: Got 'test' 4 2
(virt-viewer:21973): virt-viewer-DEBUG: Got 'redhat' 6 5
(virt-viewer:21973): virt-viewer-DEBUG: Return 0
(virt-viewer:21973): virt-viewer-DEBUG: initial connect
(virt-viewer:21973): virt-viewer-DEBUG: notebook show status 0x2671180
(virt-viewer:21973): virt-viewer-DEBUG: virt_viewer_app_set_uuid_string: UUID changed to bf6d8713-b158-4bf2-beeb-eebb5cad1f89
(virt-viewer:21973): virt-viewer-DEBUG: No guest-specific fullscreen config, using fallback
(virt-viewer:21973): virt-viewer-DEBUG: notebook show status 0x2671180
(virt-viewer:21973): virt-viewer-DEBUG: Guest demo is running, determining display
(virt-viewer:21973): virt-viewer-DEBUG: Set connect info: (null),(null),(null),-1,(null),(null),(null),0
(virt-viewer:21973): virt-viewer-DEBUG: Guest demo has a spice display
(virt-viewer:21973): virt-viewer-DEBUG: Guest graphics address is 127.0.0.1:5900
(virt-viewer:21973): virt-viewer-DEBUG: Set connect info: localhost,127.0.0.1,5900,-1,unix,(null),(null),0
(virt-viewer:21973): virt-viewer-DEBUG: Remove handle 1 8
Segmentation fault (core dumped)

(gdb) where
#0  virFileClose (fdptr=0x0, flags=flags@entry=VIR_FILE_CLOSE_PRESERVE_ERRNO) at util/virfile.c:80
#1  0x00007f222bcb6ff6 in virNetMessageFree (msg=msg@entry=0x27d0440) at rpc/virnetmessage.c:80
#2  0x00007f222bcad97a in virNetClientProgramCall (prog=prog@entry=0x2770a80, client=client@entry=0x2770600, 
    serial=serial@entry=11, proc=proc@entry=249, noutfds=noutfds@entry=1, outfds=outfds@entry=0x7fff41e84e30, 
    ninfds=ninfds@entry=0x0, infds=infds@entry=0x0, 
    args_filter=args_filter@entry=0x7f222bca8470 <xdr_remote_domain_open_graphics_args>, 
    args=args@entry=0x7fff41e84e40, ret_filter=ret_filter@entry=0x7f2228492700 <__GI_xdr_void>, 
    ret=ret@entry=0x0) at rpc/virnetclientprogram.c:398
#3  0x00007f222bc85482 in callFull (priv=priv@entry=0x276d980, flags=flags@entry=0, 
    fdin=fdin@entry=0x7fff41e84e30, fdinlen=fdinlen@entry=1, fdout=fdout@entry=0x0, fdoutlen=fdoutlen@entry=0x0, 
    proc_nr=proc_nr@entry=249, args_filter=0x7f222bca8470 <xdr_remote_domain_open_graphics_args>, 
    args=args@entry=0x7fff41e84e40 "\220m\204\002", ret_filter=0x7f2228492700 <__GI_xdr_void>, 
    ret=ret@entry=0x0, conn=<optimized out>) at remote/remote_driver.c:6698
#4  0x00007f222bc8845f in remoteDomainOpenGraphics (dom=0x2778290, idx=0, fd=<optimized out>, flags=1)
    at remote/remote_driver.c:6504
#5  0x00007f222bc6df84 in virDomainOpenGraphics (dom=0x2778290, idx=idx@entry=0, fd=20, flags=flags@entry=1)
    at libvirt.c:20300
#6  0x0000000000426d30 in virt_viewer_open_connection (self=<optimized out>, fd=0x7fff41e8501c)
    at virt-viewer.c:497
#7  0x000000000041389c in virt_viewer_app_default_activate (self=0x266f140 [VirtViewer], error=0x7fff41e851b8)
    at virt-viewer-app.c:1142
#8  0x000000000041536b in virt_viewer_app_activate (self=0x266f140 [VirtViewer], error=0x7fff41e851b8)
    at virt-viewer-app.c:1209
#9  0x00000000004271d2 in virt_viewer_initial_connect (app=0x266f140 [VirtViewer], error=0x7fff41e851b8)
    at virt-viewer.c:635
#10 0x0000000000426a70 in virt_viewer_connect (app=app@entry=0x266f140 [VirtViewer]) at virt-viewer.c:796
#11 0x0000000000426c8d in virt_viewer_start (app=0x266f140 [VirtViewer]) at virt-viewer.c:834
#12 0x0000000000414116 in virt_viewer_app_start (self=0x266f140 [VirtViewer]) at virt-viewer-app.c:1700
#13 0x000000000040fbc4 in main (argc=1, argv=0x7fff41e85518) at virt-viewer-main.c:113


Actual results:
As descritpion.

Expected results:
--attach option works well.

Additional info:

Comment 1 tingting zheng 2015-02-26 09:35:48 UTC
Tested on rhel6.6 host,--attach option works well when using virt-viewer to launch guest via UNIX connection.

Comment 2 Pavel Grunt 2015-03-09 15:05:37 UTC
fixed upstream

Comment 6 zhoujunqin 2015-06-23 06:53:37 UTC
I can reproduce this issue with package:
virt-viewer-0.6.0-12.el7.x86_64

Then try to verify with new build:
virt-viewer-2.0-3.el7.x86_64

Steps to verify:
1. Tried unix connnection by the below steps:
add auth_unix_rw="sasl" in the /etc/libvirt/libvirtd.conf

add sasl user:
# saslpasswd2 -a libvirt fred
(input your passwd: such as redhat)

Restart libvirtd server:
# service libvirtd restart

Prepare a running guest:
# virsh -c qemu+unix:///system list
Please enter your authentication name: fred
Please enter your password: 
 Id    Name                           State
----------------------------------------------------
 2     rhel6.7-snap5                  running

2.Test virt-viewer --attach option for UNIX connection:

2.1,virt-viewer to launch guest via UNIX connection without --attach.
# virt-viewer  -c qemu+unix:///system rhel6.7-snap5  --debug
(virt-viewer:17673): virt-viewer-DEBUG: connecting ...
(virt-viewer:17673): virt-viewer-DEBUG: Opening connection to libvirt with URI qemu+unix:///system
(virt-viewer:17673): virt-viewer-DEBUG: Add handle 10 1 0x21d1c00
(virt-viewer:17673): virt-viewer-DEBUG: initial connect
(virt-viewer:17673): virt-viewer-DEBUG: notebook show status 0x21b6180
(virt-viewer:17673): virt-viewer-DEBUG: virt_viewer_app_set_uuid_string: UUID changed to 60866799-b8c9-44ea-a921-ed892a910b76
(virt-viewer:17673): virt-viewer-DEBUG: No guest-specific fullscreen config, using fallback
(virt-viewer:17673): virt-viewer-DEBUG: notebook show status 0x21b6180
(virt-viewer:17673): virt-viewer-DEBUG: Guest rhel6.7-snap5 is running, determining display
(virt-viewer:17673): virt-viewer-DEBUG: Set connect info: (null),(null),(null),-1,(null),(null),(null),0
(virt-viewer:17673): virt-viewer-DEBUG: Guest rhel6.7-snap5 has a spice display
(virt-viewer:17673): virt-viewer-DEBUG: Guest graphics address is 127.0.0.1:5900
(virt-viewer:17673): virt-viewer-DEBUG: Set connect info: localhost,127.0.0.1,5900,-1,unix,(null),(null),0
(virt-viewer:17673): virt-viewer-DEBUG: Error operation forbidden: read only access prevents virDomainOpenGraphicsFD
(virt-viewer:17673): virt-viewer-DEBUG: After open connection callback fd=-1
(virt-viewer:17673): virt-viewer-DEBUG: Opening direct TCP connection to display at 127.0.0.1:5900:-1
(virt-viewer:17673): virt-viewer-DEBUG: New spice channel 0x21fb000 SpiceMainChannel 0
(virt-viewer:17673): virt-viewer-DEBUG: notebook show status 0x21b6180
(virt-viewer:17673): virt-viewer-DEBUG: Add timeout 0x21fbac0 -1 0x7fe71942cfe0 0x2157360 1
(virt-viewer:17673): virt-viewer-DEBUG: main channel: opened


Result: No password needed, guest console will be launched successfully,and direct TCP connection shows in debug info.

2.2 virt-viewer to launch guest via UNIX connection with --attach.
# virt-viewer  -c qemu+unix:///system rhel6.7-snap5  -a

Result: Authentication box pop out, after input right Username/Password, guest console with be launched successfully, without any virt-viewer coredump.

So move this bug from ON_QA to VERIFIED.

Comment 8 errata-xmlrpc 2015-11-19 07:36:09 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.

https://rhn.redhat.com/errata/RHBA-2015-2211.html


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