kvm core dump on hotplug (pci_add)

Bug #419590 reported by Scott Moser
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Wishlist
Anthony Liguori
qemu-kvm (Ubuntu)
Fix Released
Wishlist
Dustin Kirkland 

Bug Description

Binary package hint: qemu-kvm

I was running a jaunty kvm guest with the following command line:
$ kvm -m 512 -hda jaunty-desktop-i386.img \
   -hdb jaunty-desktop-i386-swap.img -boot c \
   -net nic,vlan=0 -net user,vlan=0,hostfwd=tcp:127.0.0.1:59000-:5900,hostfwd=tcp:127.0.0.1:2222-:22

jaunty guest was stock jaunty x86 desktop install.

I saw the following failure when trying to test pci_add/hotplug of scsi device or network device per [1]. Both
 'pci_add 0 nic model=e1000' and
 'pci_add 0 storage file=/tmp/my.img'
cause:
 | kvm: /build/buildd/qemu-kvm-0.11.0~rc1/hw/pci.c:1029: pci_qdev_init: Assertion `pci_dev' failed.
 | Aborted (core dumped)

I have no reason to believe the guest was at all involved. I was attempting to test a fix for bug 364916.

$ apt-cache policy qemu-kvm
qemu-kvm:
  Installed: 0.11.0~rc1-0ubuntu11
  Candidate: 0.11.0~rc1-0ubuntu11
  Version table:
 *** 0.11.0~rc1-0ubuntu11 0
        500 http://us.archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status
$ lsb_release -rd
Description: Ubuntu karmic (development branch)
Release: 9.10

--
[1] http://www.linux-kvm.org/page/Hotadd_pci_devices#Use_QEMU_monitor_to_hot_add_devices

ProblemType: Bug
Architecture: amd64
Date: Wed Aug 26 20:24:52 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: LENOVO 7417CTO
Package: qemu-kvm 0.11.0~rc1-0ubuntu11
PccardctlIdent:
 Socket 0:
   no product info available
PccardctlStatus:
 Socket 0:
   no card
ProcCmdLine: root=UUID=3afd5091-ec29-41d5-85fd-cfef14bdb6e6 ro quiet splash
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-5.24-generic
SourcePackage: qemu-kvm
Uname: Linux 2.6.31-5-generic x86_64
dmi.bios.date: 04/17/2009
dmi.bios.vendor: LENOVO
dmi.bios.version: 7UET70WW (3.00 )
dmi.board.name: 7417CTO
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.modalias: dmi:bvnLENOVO:bvr7UET70WW(3.00):bd04/17/2009:svnLENOVO:pn7417CTO:pvrThinkPadT400:rvnLENOVO:rn7417CTO:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
dmi.product.name: 7417CTO
dmi.product.version: ThinkPad T400
dmi.sys.vendor: LENOVO

Related branches

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

Anthony,

Checking this bug with you upstream... Have you successfully tested pci-hot-add with qemu 0.11?

:-Dustin

Changed in qemu-kvm (Ubuntu):
importance: Undecided → Medium
Changed in qemu:
importance: Undecided → Medium
Revision history for this message
Anthony Liguori (anthony-codemonkey) wrote :

Syntax in bug report is wrong. Should be:

pci_add auto nic model=e1000
pci_add auto storage file=image.img,if=virtio

Tested this in qemu-0.11.0-rc1. No SEGV

Revision history for this message
Scott Moser (smoser) wrote :

verified that this is user error.
I'll leave this bug open, to track the SEGV on invalid input.

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

Marking wishlist. Syntax invocation is wrong. Admittedly, should segfault, hence wishlist. But not a real serious issue.

:-Dustin

Changed in qemu:
importance: Medium → Wishlist
Changed in qemu-kvm (Ubuntu):
importance: Medium → Wishlist
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Should *not* segfault.

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

Actually, I'm getting a core dump the second time I hot-attach a device.

Using Anthony's syntax:
 pci_add auto storage file=image.img,if=virtio

Then
 pci_del 0:0:6

Then
 pci_add auto storage file=image.img,if=virtio

Results in core dumping the VM.

:-Dustin

Revision history for this message
Anthony Liguori (anthony-codemonkey) wrote :
Changed in qemu:
assignee: nobody → Anthony Liguori (anthony-codemonkey)
Changed in qemu-kvm (Ubuntu):
assignee: nobody → Anthony Liguori (anthony-codemonkey)
status: Triaged → Fix Committed
status: Fix Committed → In Progress
Changed in qemu:
status: Triaged → Fix Committed
Changed in qemu-kvm (Ubuntu):
assignee: Anthony Liguori (anthony-codemonkey) → nobody
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

I uploaded a package with Anthony's patch in my PPA. Any testing would be appreciated.

:-Dustin

Changed in qemu-kvm (Ubuntu):
assignee: nobody → Dustin Kirkland (kirkland)
importance: Wishlist → High
importance: High → Wishlist
milestone: none → ubuntu-9.10
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qemu-kvm - 0.11.0-0ubuntu5

---------------
qemu-kvm (0.11.0-0ubuntu5) karmic; urgency=low

  [ Dustin Kirkland ]
  * debian/patches/10_fix_scsi_hotplug.patch: cherry-pick patch from
    upstream to fix scsi hotplug regression, LP: #432154
  * debian/patches/11_fix_virtio-blk_hot_add_after_remove.patch: cherry-pick
    patch from upstream to fix virtio hotplug add/remove, LP: #419590

  [ James Westby ]
  * Add transitional kvm and qemu packages, LP: #451508
    - Force the kvm package version to be higher so that it supercedes that
      from the kvm source. Thanks to Steve Langasek and Michael Vogt

 -- Dustin Kirkland <email address hidden> Wed, 14 Oct 2009 11:35:27 -0500

Changed in qemu-kvm (Ubuntu):
status: In Progress → Fix Released
Aurelien Jarno (aurel32)
Changed in qemu:
status: Fix Committed → 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.