Bug 591759

Summary: Segmentation fault when using vnc to view guest without vga card
Product: Red Hat Enterprise Linux 6 Reporter: Qunfang Zhang <qzhang>
Component: qemu-kvmAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: gyue, kraxel, lihuang, michen, mjenner, ndai, quintela, tburke, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.71.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-06-10 03:22:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
upstream patch none

Description Qunfang Zhang 2010-05-13 02:08:51 UTC
Description of problem:
This issue is found when verifying Bug 584902, boot a guest with a floppy device using -global and then view the guest with vnc, segmentation fault.

Command line:

/usr/libexec/qemu-kvm -nodefaults -drive
file=lxc_tech_paper.pdf,if=none,id=drive-fdc0-0-0,format=raw -global
isa-fdc.driveA=drive-fdc0-0-0 -monitor stdio -vnc :10 -drive file=rhel5.5-32.qcow2,media=disk,if=ide,cache=off -boot c 


Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.52.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1.Boot a guest with above command line
2.View it with vnc : vncviewer $HOST_IP:10
3.
  
Actual results:
(gdb) r -nodefaults -drive
file=lxc_tech_paper.pdf,if=none,id=drive-fdc0-0-0,format=raw -global
isa-fdc.driveA=drive-fdc0-0-0 -monitor stdio -vnc :10

Boot with "-vnc" option, then using "vncviewer" to view it. segmentation fault.

(qemu) 
Program received signal SIGSEGV, Segmentation fault.
0x000000000049bdc7 in vga_hw_invalidate () at console.c:169
169     if (active_console->hw_invalidate)
Missing separate debuginfos, use: debuginfo-install
cyrus-sasl-md5-2.1.23-8.el6.x86_64 cyrus-sasl-plain-2.1.23-8.el6.x86_64
db4-4.7.25-15.el6.x86_64
(gdb) bt
#0  0x000000000049bdc7 in vga_hw_invalidate () at console.c:169
#1  0x00000000004cfc39 in set_pixel_format (vs=0x16f9510, data=0x1704980 "", 
    len=<value optimized out>) at vnc.c:1892
#2  protocol_client_msg (vs=0x16f9510, data=0x1704980 "", 
    len=<value optimized out>) at vnc.c:1965
#3  0x00000000004d096b in vnc_client_read (opaque=0x16f9510) at vnc.c:1352
#4  0x000000000040b15f in main_loop_wait (timeout=1000)
    at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:4059
#5  0x000000000042864a in kvm_main_loop ()
    at /usr/src/debug/qemu-kvm-0.12.1.2/qemu-kvm.c:2127
#6  0x000000000040e17b in main_loop (argc=<value optimized out>, 
    argv=<value optimized out>, envp=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:4269
#7  main (argc=<value optimized out>, argv=<value optimized out>, 
    envp=<value optimized out>) at /usr/src/debug/qemu-kvm-0.12.1.2/vl.c:6411
(gdb)    


Expected results:


Additional info:

Comment 2 RHEL Product and Program Management 2010-05-13 04:17:14 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 3 Gerd Hoffmann 2010-05-18 19:18:47 UTC
Simple "/usr/libexec/qemu-kvm -nodefaults -vnc :10 -cdrom /mort/distiso/rhel6-beta/RHEL6.0-20100506.3-Server-x86_64-DVD1.iso" segfaults too.  Removing -nodefaults makes it boot fine.  So it isn't related to floppy at all.  Investigating ...

Comment 4 Gerd Hoffmann 2010-05-18 19:34:54 UTC
Ah.  -nodefaults makes qemu not plug in a default vga card.  So if you don't add one with -vga <something> qemu boots the guest without vga plugged in.  Seems vnc doesn't handle this very gracefully ...

Comment 5 Gerd Hoffmann 2010-05-18 19:46:36 UTC
Created attachment 414951 [details]
upstream patch

Comment 6 Gerd Hoffmann 2010-05-20 13:25:40 UTC
Patch submitted upstream
http://patchwork.ozlabs.org/patch/52916/

Comment 7 Gerd Hoffmann 2010-06-01 19:56:16 UTC
Patch committed upstream
http://git.qemu.org/qemu.git/commit/?id=26572b8a0e90ee0c77587173a78fa293a1d2beb6

Comment 11 Qunfang Zhang 2010-06-10 03:21:46 UTC
Verified on qemu-kvm-0.12.1.2-2.72.el6, passed.