KVM crashes when -vga is set to vmware.

Bug #414885 reported by Evan
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Medium
Unassigned
Gentoo Linux
New
Undecided
Unassigned
qemu-kvm (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: kvm

KVM segfaults when the -vga vmware option is set. Host is an up to date Karmic system. Guest is the Karmic daily-live from 20090817.

ProblemType: Bug
Architecture: amd64
Date: Mon Aug 17 16:34:44 2009
DistroRelease: Ubuntu 9.10
KvmCmdLine: Error: command ['ps', '-C', 'kvm', '-F'] failed with exit code 1: UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
MachineType: Apple Computer, Inc. iMac6,1
NonfreeKernelModules: nvidia wl
Package: kvm 1:84+dfsg-0ubuntu16
ProcCmdLine: root=UUID=0666f72f-99e1-4948-b718-220f48093423 ro quiet splash
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-4.23-generic
SourcePackage: kvm
Uname: Linux 2.6.31-4-generic x86_64
dmi.bios.date: 10/12/06
dmi.bios.vendor: Apple Computer, Inc.
dmi.bios.version: IM61.88Z.0093.B01.0610121338
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: Mac-F4218FC8
dmi.board.vendor: Apple Computer, Inc.
dmi.board.version: DVT
dmi.chassis.asset.tag: Asset Tag
dmi.chassis.type: 13
dmi.chassis.vendor: Apple Computer, Inc.
dmi.chassis.version: Mac-F4218FC8
dmi.modalias: dmi:bvnAppleComputer,Inc.:bvrIM61.88Z.0093.B01.0610121338:bd10/12/06:svnAppleComputer,Inc.:pniMac6,1:pvr1.0:rvnAppleComputer,Inc.:rnMac-F4218FC8:rvrDVT:cvnAppleComputer,Inc.:ct13:cvrMac-F4218FC8:
dmi.product.name: iMac6,1
dmi.product.version: 1.0
dmi.sys.vendor: Apple Computer, Inc.

Revision history for this message
Evan (ev) wrote :
Revision history for this message
Evan (ev) wrote :
Changed in kvm (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

I'm confirming this on current Karmic qemu-kvm-0.11. It's not segfaulting, however, so I'm changing the title accordingly, and lowering the priority to 'low', since it's not crashing. Still, I'm not seeing any output in the window.

Also, I'll copy this to upstream QEMU, as they're aware of this, and working the issue (perhaps).

:-Dustin

affects: kvm (Ubuntu) → qemu-kvm (Ubuntu)
Changed in qemu-kvm (Ubuntu):
importance: Medium → Low
status: New → Confirmed
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Doh!

Eating my words now... Just needed to give the VM a little more time. Segfault. Boom.

kirkland@x200:/local/virt/img$ kvm -hda karmic-desktop.img -vga vmware
vmsvga_value_write: guest runs Linux.
Segmentation fault (core dumped)

Upping to 'medium' again.

:-Dustin

Changed in qemu-kvm (Ubuntu):
importance: Low → Medium
Changed in qemu:
status: New → Confirmed
importance: Undecided → Medium
Changed in qemu:
milestone: none → 0.12.0
Revision history for this message
Ben Crawford (ebbeyes) wrote :

Same error
vmsvga_value_write: guest runs Linux.
/home/ebb/scripts/ubuntukvm: line 1: 8273 Segmentation fault kvm -vga vmware -m 1024 -soundhw es1370 -hda ubuntudisk.img -net nic,macaddr=00:1d:92:ab:3f:80 -net tap,ifname=tap2,script=no,downscript=no

Guest is ubuntu-9.10-desktop-i386

Revision history for this message
Roland Dreier (roland.dreier) wrote :

I see this too (Lucid guest). As a workaround, using "-vnc :1" instead of the default sdl output lets me use -vga vmware.

Revision history for this message
Roland Dreier (roland.dreier) wrote :

I figured out the cause of the crash, at least in my system. With SDL, qemu-kvm advertises the cursor setting capability to the guest, and therefore gets a DEFINE_CURSOR command. In the crashing case, it gets a request for a 64x64 cursor at 32bpp, which requires 64*64 = 4096 32-bit words to store. However struct vmsvga_cursor_definition_s.image[] is declared to have size only 1024, so handling the cursor request overruns the array.

I'm attaching a patch that enlarges the image array, which fixes the issue (for me at least -- I am able to run a Lucid guest with the vmware X.org driver on a Karmic host with "-vga vmware" with this applied, which used to crash). I've not checked if upstream has fixed this yet.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Excellent, thanks, Roland.

We can carry that patch in Ubuntu.

To get it upstream, you're going to need to submit it to the qemu-devel mailing list. Anthony isn't able to take patches submitted through Launchpad, unfortunately...

Changed in qemu-kvm (Ubuntu):
status: Confirmed → Triaged
Changed in qemu:
status: Confirmed → Triaged
Changed in qemu-kvm (Ubuntu):
assignee: nobody → Dustin Kirkland (kirkland)
Revision history for this message
Roland Dreier (roland.dreier) wrote :

OK, I've sent this on upstream and in fact there is a whole series of vmware_vga stuff at <http://<email address hidden>/> that might be worth picking up.

I think it would be nice to get a fixed qemu-kvm into Karmic during the Lucid cycle, since vmware is the fastest video driver for kvm, and being able to test Lucid images in Karmic would be nice.

Are you planning on picking up qemu 0.12 for Lucid? Seems like it would be a good idea, since the new stable series would probably be better supportable long-term.

Revision history for this message
Roland Dreier (roland.dreier) wrote :

Er, <http://<email address hidden>/msg21420.html> is the series of vmware patches.

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 414885] Re: KVM crashes when -vga is set to vmware.

Off-topic, but yes, I'm trying to package qemu-kvm-0.12 right now.
There are a number of blocking issues with the release, though.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Hmm, still broken on qemu-0.12.1.2. Screenshot attached.

Anthony, can you reproduce on HEAD?

Changed in qemu-kvm (Ubuntu):
assignee: Dustin Kirkland (kirkland) → nobody
Revision history for this message
Roland Dreier (roland.dreier) wrote :

Dustin: not sure what that screenshot you uploaded is. Is that the qemu-kvm window itself?

If so I don't think you're seeing the same bug -- the issue being tracked here (and which I'm pretty sure is fixed in qemu 0.12) is a problem where the vmware-vga has a buffer overrun and crashes the host kvm process. Your screenshot looks more like the guest crashing to me -- what guest is it?

Revision history for this message
Roland Dreier (roland.dreier) wrote :

I just tested the latest lucid-desktop live CD with -vga vmware on a lucid host, and it works fine. Host has:

$ apt-cache policy qemu-kvm
qemu-kvm:
  Installed: 0.12.2-0ubuntu1
  Candidate: 0.12.2-0ubuntu1
  Version table:
 *** 0.12.2-0ubuntu1 0
        500 http://us.archive.ubuntu.com lucid/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Cool! Thanks.

Changed in qemu:
status: Triaged → Fix Released
Changed in qemu-kvm (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.