cannot kill kvm process that uses 'tap'

Bug #685991 reported by Jamie Strandboge
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
High
Unassigned
qemu-kvm (Ubuntu)
Invalid
High
Serge Hallyn

Bug Description

Binary package hint: qemu-kvm

On up to date Natty and kernel 2.6.37-7.19-generic I cannot kill kvm processes when they are started with 'tap', even with 'kill -9'. This has been true for at least the last several Natty kernels. If I reboot into a maverick kernel, all is well. I first noticed this when I tried to stop a VM in libvirt. The qemu-kvm command line:
/usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 384 -smp 1,sockets=1,cores=1,threads=1 -name sec-dapper-amd64 -uuid 29810304-fac2-d840-ab12-21a001a66e54 -nodefconfig -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/sec-dapper-amd64.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=utc -boot c -drive file=/home/jamie/vms/kvm/sec-dapper-amd64/disk0.qcow2,if=none,id=drive-ide0-0-0,format=qcow2,cache=writeback -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -netdev tap,fd=40,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=52:54:00:9e:ae:5d,bus=pci.0,addr=0x3 -usb -vnc 127.0.0.1:0 -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4

Trying to shutdown the VM results in the following in dmesg:
[39656.368496] unregister_netdevice: waiting for vnet0 to become free. Usage count = 1

Trying to find a reduced test case, I tried:
$ /usr/bin/kvm -M pc -m 256 -no-acpi -drive file=./disk0.qcow2 -net nic,vlan=0 -net tap,vlan=0,ifname=tap0

This resulted in a VM that would not start (it uses /etc/qemu-ifup since I did not specify a 'script=' parameter). This kvm process is unkillable with kill -9, but nothing in dmesg.

Then I tried the following:
/usr/bin/kvm -M pc -m 256 -no-acpi -drive file=./disk0.qcow2 -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=

This resulted in a VM that would start, but the kvm process is unkillable with kill -9, but nothing in dmesg.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: qemu-kvm 0.13.0+noroms-0ubuntu9
ProcVersionSignature: Ubuntu 2.6.37-7.19-generic 2.6.37-rc3
Uname: Linux 2.6.37-7-generic x86_64
Architecture: amd64
Date: Mon Dec 6 08:30:39 2010
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100427.1)
KvmCmdLine:
 UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
 root 4536 1 0 29363 3340 2 08:18 ? 00:00:00 /usr/bin/kvm -M pc -m 256 -no-acpi -drive file=./disk0.qcow2 -net nic,vlan=0 -net tap,vlan=0,ifname=tap0
 root 4633 1 7 108952 253696 1 08:19 ? 00:00:51 /usr/bin/kvm -M pc -m 256 -no-acpi -drive file=./disk0.qcow2 -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=
MachineType: LENOVO 5129CTO
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.utf8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.37-7-generic root=UUID=82571cfb-fdda-4d2f-b708-f8924aa0fe21 ro quiet splash
SourcePackage: qemu-kvm
dmi.bios.date: 04/20/2010
dmi.bios.vendor: LENOVO
dmi.bios.version: 6QET44WW (1.14 )
dmi.board.name: 5129CTO
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:bvr6QET44WW(1.14):bd04/20/2010:svnLENOVO:pn5129CTO:pvrThinkPadX201s:rvnLENOVO:rn5129CTO:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
dmi.product.name: 5129CTO
dmi.product.version: ThinkPad X201s
dmi.sys.vendor: LENOVO

Revision history for this message
Jamie Strandboge (jdstrand) wrote :
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Adding a linux task since this seems like a kernel problem. Please invalidate qemu-kvm or linux as necessary.

summary: - cannot stop kvm processing that use 'tap'
+ cannot kill kvm process that uses 'tap'
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Yeah this really sounds like a kernel refcount bug. However, I'll
try to reproduce with upstream kvm, and then upstream latest kernel.

Changed in qemu-kvm (Ubuntu):
assignee: nobody → Serge Hallyn (serge-hallyn)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

This bug does NOT happen with the latest kernel from
http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/current/

Changed in qemu-kvm (Ubuntu):
status: Confirmed → Invalid
Changed in linux (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

I'd guess that upstream commit 853dc2e03ddd0c49885ed55c48755d2b1073122a
was involved in fixing it.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

No, I think that's in the natty kernel already, so guess not...

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Actually, compiling my own kernel from git://kernel.ubuntu.com/ubuntu/ubuntu-natty.git
that kernel also works?

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Ah, there you go - 2.6.37.7.9 (still default with natty) fails, 2.6.38.8 succeeds.

tags: added: kernel-series-unknown
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

This is no longer a problem with 2.6.37-8.21-generic 2.6.37-rc4.

Changed in linux (Ubuntu):
status: Confirmed → 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.