Bug 438560

Summary: virt-viewer segfaults using a ssh forwarded X connection
Product: [Fedora] Fedora Reporter: Kevin Fenzi <kevin>
Component: virt-viewerAssignee: Daniel Berrange <berrange>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9CC: fdc, hbrock
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-12-12 02:03:01 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Kevin Fenzi 2008-03-21 17:59:00 EDT
Using a ssh forwarded connection from a F8 machine to a rawhide host, I try and
run virt-viewer there. This worked with a F8 host, but on the now rawhide host I
get: 

# virt-viewer -c qemu:///system 4
libGL error: open DRM failed (Operation not permitted)
libGL error: reverting to (slow) indirect rendering
Segmentation fault

A gdb trace with virt-viewer debuginfo installed shows: 

(gdb) run -c qemu:///system 4
Starting program: /usr/bin/virt-viewer -c qemu:///system 4
[Thread debugging using libthread_db enabled]
[New Thread 0x7fa02b28c790 (LWP 20704)]
libGL error: open DRM failed (Operation not permitted)
libGL error: reverting to (slow) indirect rendering

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fa02b28c790 (LWP 20704)]
0x0000000000000000 in ?? ()
Missing separate debuginfos, use: debuginfo-install cairo.x86_64
cyrus-sasl.x86_64 expat.x86_64 fontconfig.x86_64 freetype.x86_64 gcc.x86_64
gtk2.x86_64 gtkglext.x86_64 libICE.x86_64 libSM.x86_64 libX11.x86_64
libXau.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64
libXdmcp.x86_64 libXext.x86_64 libXfixes.x86_64 libXi.x86_64 libXinerama.x86_64
libXmu.x86_64 libXrandr.x86_64 libXrender.x86_64 libXt.x86_64 libXxf86vm.x86_64
libdrm.x86_64 libgcrypt.x86_64 libgpg-error.x86_64 libpng.x86_64
libselinux.x86_64 libtasn1.x86_64 libxcb.x86_64 mesa.x86_64 pixman.x86_64
zlib.x86_64
(gdb) where
#0  0x0000000000000000 in ?? ()
#1  0x00007fa03074f9b2 in ?? () from /usr/lib64/libGL.so.1
#2  0x00007fa03072c9f5 in ?? () from /usr/lib64/libGL.so.1
#3  0x00007fa03072ce63 in glXCreateContext () from /usr/lib64/libGL.so.1
#4  0x00007fa030c41e94 in _gdk_x11_gl_context_new ()
   from /usr/lib64/libgdkglext-x11-1.0.so.0
#5  0x000000000206191e in gtk_widget_create_gl_context ()
   from /usr/lib64/libgtkglext-x11-1.0.so.0
#6  0x0000000002061a01 in gtk_widget_get_gl_context ()
   from /usr/lib64/libgtkglext-x11-1.0.so.0
#7  0x0000000000619e88 in realize_event (widget=0x260dbb0, data=<value optimized
out>)
    at vncdisplay.c:706
#8  0x00000000015776dd in IA__g_closure_invoke (closure=0x26158d0,
return_value=0x0, 
    n_param_values=1, param_values=0x7fff3981a850, invocation_hint=0x7fff3981a750)
    at gclosure.c:490
#9  0x000000000158b6c1 in signal_emit_unlocked_R (node=0x26027a0, detail=0, 
    instance=0x260dbb0, emission_return=0x0, instance_and_params=0x7fff3981a850)
    at gsignal.c:2440
#10 0x000000000158cb9c in IA__g_signal_emit_valist (instance=0x260dbb0, 
    signal_id=<value optimized out>, detail=0, var_args=0x7fff3981aab0) at
gsignal.c:2199
#11 0x000000000158d0e3 in IA__g_signal_emit (instance=0x26159e0,
signal_id=39940720, 
    detail=0) at gsignal.c:2243
#12 0x0000000000d9824a in gtk_widget_realize () from /usr/lib64/libgtk-x11-2.0.so.0
#13 0x0000000000403dea in viewer_start (uri=<value optimized out>,
name=0x262ba40 "", 
    direct=0, waitvnc=<value optimized out>, set_verbose=<value optimized out>, 
    get_toplevel=0x403420 <viewer_get_toplevel>, data=0x0, with_menubar=1) at
main.c:843
#14 0x0000000000404668 in main (argc=4, argv=0x7fff3981aec8) at main.c:947

Happy to provide more info or try workarounds.
Comment 1 Daniel Berrange 2008-03-21 19:14:51 EDT
FYI, there is no need to run virt-viewer over an SSH forwarded X connection. It
is capable of tunnelling the VNC protocol over SSH itself which is much more
efficient. Assuming you have SSH keys + SSH agent setup you ought to be able to
run it with a command line arg such as:

  virt-viewer --connect  qemu+ssh://root@somehost/system  4


and it will automagically forward everything over SSH, which should let you work
around this bug.

Of course we still need to fix this SEGV crash too...
Comment 2 Kevin Fenzi 2008-03-21 19:37:46 EDT
Indeed. That does seem to work... ;) Will start using that... 
Comment 3 Bug Zapper 2008-05-14 02:47:20 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 4 François Cami 2008-12-11 18:00:07 EST
virt-viewer works (no SEGV, at least) fine through ssh in FC10.
Kevin, could you confirm that this is fixed ?
Comment 5 Kevin Fenzi 2008-12-11 18:27:42 EST
Happily I can confirm that it does seem to be fixed here. ;) 

I guess this can be closed now?
Comment 6 François Cami 2008-12-11 19:02:59 EST
Thank you Kevin. Will close ASAP.
Comment 7 François Cami 2008-12-12 02:03:01 EST
Neither original reporter nor I can reproduce this nine month old bug.

Closing.