Bug 1250820 - virt-viewer crashed when switch the tty of guest that with "-vga std" and "-device qxl..."
virt-viewer crashed when switch the tty of guest that with "-vga std" and "-d...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-viewer (Show other bugs)
7.2
x86_64 Unspecified
low Severity low
: rc
: 7.3
Assigned To: Pavel Grunt
Virtualization Bugs
:
Depends On:
Blocks: 1310974 1343240
  Show dependency treegraph
 
Reported: 2015-08-06 01:46 EDT by Qian Guo
Modified: 2016-11-03 21:09 EDT (History)
14 users (show)

See Also:
Fixed In Version: virt-viewer-2.0-10.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1310974 1343240 (view as bug list)
Environment:
Last Closed: 2016-11-03 21:09:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Comment 13 xiaodwan 2016-02-19 03:24:30 EST
I can make a segment fault by adding two video card, and then connect to the vm by "remote-viewer spice://localhost:5900". After connecting to the vm, the remote-viewer window crashes automatically. I'm not sure if it's the original bug. but I think it's the same because the backtrace looks same as in comment 5.

$ rpm -q qemu-kvm-rhev virt-viewer
qemu-kvm-rhev-2.3.0-23.el7.x86_64
virt-viewer-2.0-6.el7.x86_64

<video>
      <model type='cirrus' vram='16384' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/>
      <alias name='video1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </video>

(gdb) bt
#0  0x000000000041bf55 in virt_viewer_display_get_preferred_monitor_geometry (self=0x0) at virt-viewer-display.c:696
#1  0x000000000041bf55 in virt_viewer_display_get_preferred_monitor_geometry (self=self@entry=0x0, preferred=0x24119b0) at virt-viewer-display.c:785
#2  0x0000000000419dc7 in virt_viewer_session_on_monitor_geometry_changed (self=0x1e66250 [VirtViewerSessionSpice], display=<optimized out>) at virt-viewer-session.c:377
#6  0x00007f75d3f4977f in <emit signal notify:agent-connected on instance 0x1e95340 [SpiceMainChannel]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3365
    #3  0x00007f75d3f2fe38 in g_closure_invoke (closure=0x1e95bc0, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7ffdfb848980, invocation_hint=invocation_hint@entry=0x7ffdfb848920) at gclosure.c:768
    #4  0x00007f75d3f4175d in signal_emit_unlocked_R (node=node@entry=0x1bf09d0, detail=detail@entry=1561, instance=instance@entry=0x1e95340, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffdfb848980) at gsignal.c:3553
    #5  0x00007f75d3f494c1 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffdfb848b10)
    at gsignal.c:3309
#7  0x00007f75d3f34505 in g_object_dispatch_properties_changed (object=0x1e95340 [SpiceMainChannel], n_pspecs=29992736, pspecs=0x7f75d37b5778 <main_arena+24>)
    at gobject.c:1056
#8  0x00007f75d3f36a29 in g_object_notify (pspec=<optimized out>, object=0x1e95340 [SpiceMainChannel]) at gobject.c:1150
#9  0x00007f75d3f36a29 in g_object_notify (object=0x1e95340 [SpiceMainChannel], property_name=<optimized out>) at gobject.c:1197
#10 0x00007f75d5571b10 in notify_main_context (opaque=0x7f75ba8a2990) at gio-coroutine.c:238
#11 0x00007f75d3a2179a in g_main_context_dispatch (context=0x1c13ee0) at gmain.c:3109
#12 0x00007f75d3a2179a in g_main_context_dispatch (context=context@entry=0x1c13ee0) at gmain.c:3708
#13 0x00007f75d3a21ae8 in g_main_context_iterate (context=0x1c13ee0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3779
#14 0x00007f75d3a21dba in g_main_loop_run (loop=0x1e3d9e0) at gmain.c:3973
#15 0x00007f75d5a5c045 in gtk_main () at gtkmain.c:1207
#16 0x0000000000411152 in main (argc=1, argv=0x7ffdfb848fc8) at remote-viewer-main.c:192
Comment 14 xiaodwan 2016-02-19 03:43:25 EST
Additional info:
I cannot reproduce it on rhel6.7 following the steps in comment 13.
 
Remote-viewer can connect to display 1 successfully. but after opening display 2, it always displays "Waiting for display 2...".
Comment 15 Pavel Grunt 2016-02-19 04:09:28 EST
(In reply to xiaodwan from comment #14)
> Additional info:
> I cannot reproduce it on rhel6.7 following the steps in comment 13.
>  
> Remote-viewer can connect to display 1 successfully. but after opening
> display 2, it always displays "Waiting for display 2...".

Is the host the same - qemu-kvm-rhev-2.3.0-23.el7.x86_64 ?
Comment 16 xiaodwan 2016-02-19 04:47:31 EST
(In reply to Pavel Grunt from comment #15)
> (In reply to xiaodwan from comment #14)
> > Additional info:
> > I cannot reproduce it on rhel6.7 following the steps in comment 13.
> >  
> > Remote-viewer can connect to display 1 successfully. but after opening
> > display 2, it always displays "Waiting for display 2...".
> 
> Is the host the same - qemu-kvm-rhev-2.3.0-23.el7.x86_64 ?

No, it's not.

I created a vm by adding two video cards by virt-manager on rhel6 and then connect it by remote-viewer on the same host. But i didn't reproduce it.

Now I reproduced it on rhel6,  by connecting to the same vm on rhel7 in comment 13.
Comment 17 Fabiano Fidêncio 2016-03-15 11:53:26 EDT
A proposed "fix" (avoid the crash, nothing more) was sent to the mailing list:
http://www.redhat.com/archives/virt-tools-list/2016-March/msg00118.html
Comment 18 Mike McCune 2016-03-28 19:26:37 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 21 Radek Duda 2016-06-09 11:42:14 EDT
I think that proposed patch does not work well. 
My configuration:
qemu-kvm-1.5.3-113.el7.x86_64
virt-viewer-2.0-8.el7.x86_64
I used also two video cards:
<video>
      <model type='cirrus' vram='16384' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/>
      <alias name='video1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</video>
like in comment 13 for both rhel 7.3 guest and rhel 6.8 VM guests.
When I connect to rhel6.8 with remote-viewer, it displays Connected to graphic server and after a while in log:
(remote-viewer:18955): remote-viewer-CRITICAL **: virt_viewer_shift_monitors_to_origin: assertion 'xmin < G_MAXINT && ymin < G_MAXINT' failed. VM screen is not displayed.

If I connect to rhel 7.3 right after its boot several messages 

(remote-viewer:19689): remote-viewer-WARNING **: Unsupported graphics configuration:
spice-gtk only supports multiple graphics channels if they are single-head

are displayed. The system is loading almost to the state when GDM login screen appears, but then remote-viewer crashes with Segmentation fault

dmesg:[ 9088.423794] remote-viewer[20171]: segfault at 0 ip 0000000000411d0a sp 00007ffe5855b950 error 4 in remote-viewer[400000+3b000]

gdb:
Program received signal SIGSEGV, Segmentation fault.
displays_cmp (p1=p1@entry=0xbad940, p2=p2@entry=0xbad944, 
    user_data=user_data@entry=0x8eb180) at virt-viewer-util.c:544
544	    diff = m1->x - m2->x;
(gdb) bt
#0  0x0000000000411d0a in displays_cmp (p1=p1@entry=0xbad940, p2=p2@entry=0xbad944, user_data=user_data@entry=0x8eb180) at virt-viewer-util.c:544
#1  0x00007ffff3f16ac5 in msort_with_tmp (p=0x7fffffffd670, b=0xbad940, n=2)
    at gqsort.c:93
#2  0x00007ffff3f16ded in msort_r (b=b@entry=0xbad940, n=n@entry=2, s=s@entry=4, cmp=cmp@entry=0x411ce0 <displays_cmp>, arg=arg@entry=0x8eb180) at gqsort.c:278
#3  0x00007ffff3f16e78 in g_qsort_with_data (pbase=pbase@entry=0xbad940, total_elems=total_elems@entry=2, size=size@entry=4, compare_func=compare_func@entry=0x411ce0 <displays_cmp>, user_data=user_data@entry=0x8eb180) at gqsort.c:303
#4  0x000000000041277c in virt_viewer_align_monitors_linear (displays=displays@entry=0x8eb180 = {...}) at virt-viewer-util.c:586
#5  0x000000000041a92d in virt_viewer_session_on_monitor_geometry_changed (self=0x8f38a0 [VirtViewerSessionSpice], display=<optimized out>)
    at virt-viewer-session.c:373
#9  0x00007ffff442fd9f in <emit signal notify:agent-connected on instance 0x930440 [SpiceMainChannel]> (instance=instance@entry=0x930440, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3439
    #6  0x00007ffff4415908 in g_closure_invoke (closure=0x9306c0, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7fffffffd960, invocation_hint=invocation_hint@entry=0x7fffffffd900)
    at gclosure.c:801
    #7  0x00007ffff4427a1d in signal_emit_unlocked_R (node=node@entry=0x668f80, detail=detail@entry=1551, instance=instance@entry=0x930440, emission_return=emis
sion_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffd960) at gsignal.c:3627
    #8  0x00007ffff442fab1 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffdaf0) at gsignal.c:3383
#10 0x00007ffff4419fd4 in g_object_dispatch_properties_changed (object=0x930440 [SpiceMainChannel], n_pspecs=<optimized out>, pspecs=<optimized out>)
    at gobject.c:1061
#11 0x00007ffff441c4f9 in g_object_notify (pspec=<optimized out>, object=0x930440 [SpiceMainChannel]) at gobject.c:1155
#12 0x00007ffff441c4f9 in g_object_notify (object=0x930440 [SpiceMainChannel], property_name=<optimized out>) at gobject.c:1202
#13 0x00007ffff5a63dd0 in notify_main_context (opaque=0x7fffd6fde990)
    at gio-coroutine.c:240
#14 0x00007ffff3f07d7a in g_main_context_dispatch (context=0x68da40)
    at gmain.c:3152
#15 0x00007ffff3f07d7a in g_main_context_dispatch (context=context@entry=0x68da40) at gmain.c:3767
#16 0x00007ffff3f080b8 in g_main_context_iterate (context=0x68da40, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3838
#17 0x00007ffff3f0838a in g_main_loop_run (loop=0x710de0) at gmain.c:4032
#18 0x00007ffff5f53045 in gtk_main () at gtkmain.c:1207
#19 0x0000000000411a22 in main (argc=1, argv=0x7fffffffdfa8)


then, if I connect with remote-viewer again and login (mouse cursor does not work in GDM login screen ?! - do not know why), another segfault crash happens.

Then after another remote-viewer connection, it seems that everything works fine except mentioned mouse cursor issue.
Fix in comment 19 states that crash should be avoided.. so it dos not work for me.
Comment 23 Pavel Grunt 2016-06-21 03:07:34 EDT
(In reply to Radek Duda from comment #21)
...
> 
> Fix in comment 19 states that crash should be avoided.. so it dos not work
> for me.

Do I read it correctly, that it "failed qa" ?

Commits for avoiding the crash:
99d81d2fde97b43ceaf3490a16b028eb21c8ea71
cb4ec1fc8088df4bedfc310668cbc6b4938497e2
Comment 24 Radek Duda 2016-06-21 04:44:31 EDT
(In reply to Pavel Grunt from comment #23)
> (In reply to Radek Duda from comment #21)
> ...
> > 
> > Fix in comment 19 states that crash should be avoided.. so it dos not work
> > for me.
> 
> Do I read it correctly, that it "failed qa" ?
> 
> Commits for avoiding the crash:
> 99d81d2fde97b43ceaf3490a16b028eb21c8ea71
> cb4ec1fc8088df4bedfc310668cbc6b4938497e2

Yes
Comment 25 Pavel Grunt 2016-06-21 05:00:18 EDT
Patches posted and pushed upstream as commits:
99d81d2fde97b43ceaf3490a16b028eb21c8ea71
cb4ec1fc8088df4bedfc310668cbc6b4938497e2
https://www.redhat.com/archives/virt-tools-list/2016-June/msg00075.html
Comment 27 xiaodwan 2016-07-04 05:26:32 EDT
I prepared a spice guest with cirrus+qxl, then verified it with virt-viewer-2.0-10.el7.x86_64, 

    <graphics type='spice' port='5900' autoport='yes' listen='0::0'>
      <listen type='address' address='0::0'/>
      <image compression='off'/>
    </graphics>
    <video>
      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384'/>
      <alias name='video1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </video>


After opening the guest, virt-viewer/remote-viewer doesn't crash now, and log "Unsupported graphics configuration" display. 

(virt-viewer:15795): virt-viewer-WARNING **: Unsupported graphics configuration:
spice-gtk only supports multiple graphics channels if they are single-head


Since it's not supported for that kind of configuration(In fact, it can work, but working badly, for example, badly mouse event, only one display can display the deskop, cannot adjust resolution automatically, etc) and the expected result is not crash for this case, I'm going to move this bug from ON_QA to VERIFIED.
Comment 30 errata-xmlrpc 2016-11-03 21:09:26 EDT
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-2016-2229.html

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