kvm hangs at 100% cpu when connecting to forwarded ports (when listed incorrectly on the command line)

Bug #453617 reported by Jesse Michael
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned
qemu-kvm (Ubuntu)
Fix Released
Low
Dustin Kirkland 
Lucid
Fix Released
Low
Dustin Kirkland 

Bug Description

Binary package hint: qemu-kvm

If kvm is started using two separate "-net user,hostfwd=<forwarding rule>" arguments to forward ports from the host to the client, it won't complain, but will return a connection refused error and hang at 100% cpu when trying to connect to either forwarded port.

However, if kvm is started with the hostfwd rules combined together into a single "-net user" argument, it works fine.

As an example, this command line doesn't generate any warnings or errors, but causes kvm to hang for me:

kvm -net nic -net user,hostfwd=tcp:127.0.0.1:8888-:80 -net user,hostfwd=tcp:127.0.0.1:2222-:22 -m 128 -smp 1 -drive file=disk0.qcow2

... but this command line works fine:

kvm -net nic -net user,hostfwd=tcp:127.0.0.1:8888-:80,hostfwd=tcp:127.0.0.1:2222-:22 -m 128 -smp 1 -drive file=disk0.qcow2

ProblemType: Bug
Architecture: amd64
Date: Fri Oct 16 17:19:59 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: Sony Corporation VGN-SZ650N
NonfreeKernelModules: nvidia
Package: kvm (not installed)
PccardctlIdent:
 Socket 0:
   no product info available
PccardctlStatus:
 Socket 0:
   no card
ProcCmdLine: root=UUID=3ee4953e-48f0-497c-ae78-18cbb18cfef8 ro quiet splash
ProcEnviron:
 LANGUAGE=en_US.UTF-8
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-14.47-generic
SourcePackage: qemu-kvm
Uname: Linux 2.6.31-14-generic x86_64
dmi.bios.date: 07/12/2007
dmi.bios.vendor: Phoenix Technologies LTD
dmi.bios.version: R0081S5
dmi.board.asset.tag: N/A
dmi.board.name: VAIO
dmi.board.vendor: Sony Corporation
dmi.board.version: N/A
dmi.chassis.type: 10
dmi.chassis.vendor: Sony Corporation
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnPhoenixTechnologiesLTD:bvrR0081S5:bd07/12/2007:svnSonyCorporation:pnVGN-SZ650N:pvrJ002VXGP:rvnSonyCorporation:rnVAIO:rvrN/A:cvnSonyCorporation:ct10:cvrN/A:
dmi.product.name: VGN-SZ650N
dmi.product.version: J002VXGP
dmi.sys.vendor: Sony Corporation

Related branches

Revision history for this message
Jesse Michael (jesse.michael) wrote :
Soren Hansen (soren)
Changed in qemu-kvm (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Torsten Spindler (tspindler) wrote :

On Lucid alpha 3 an error is reported and kvm stops:

$ sudo kvm -net nic -net user,hostfwd=tcp:127.0.0.1:8888-:80 -net user,hostfwd=tcp:127.0.0.1:2222-:22 -m 128 -smp 1 -drive file=disk0.qcow2kvm -net nic -net user,hostfwd=tcp:127.0.0.1:8888-:80 -net user,hostfwd=tcp:127.0.0.1:2222-:22 -m 128 -smp 1 -drive file=lucid.qcow2
could not set up host forwarding rule 'tcp:127.0.0.1:8888-:80'

qemu-kvm Version: 0.12.3-0ubuntu2

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

Torsten-

Check your command line. Looks like you double-pasted the faulty command.

Jesse-

I can actually confirm this in Lucid's qemu-kvm 0.12.3. I ran your exact two lines and it seems to lock my kvm process and eat a bunch of cpu.

The symptoms look very similar to Bug #474968.

Anthony, can we have a look at this?

Changed in qemu:
status: New → Confirmed
summary: - kvm hangs at 100% cpu when connecting to forwarded ports
+ kvm hangs at 100% cpu when connecting to forwarded ports (when listed
+ incorrectly on the command line)
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

At the very least, the manpage needs to be updated, as the "hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport" section says: "This option can be given multiple times."

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

The documentation aspect of this bug should be fix along with Bug #474969.

Changed in qemu-kvm (Ubuntu Lucid):
assignee: nobody → Brian Thomason (brian-thomason)
milestone: none → ubuntu-10.04-beta-1
Thierry Carrez (ttx)
Changed in qemu-kvm (Ubuntu Lucid):
milestone: ubuntu-10.04-beta-1 → none
Changed in qemu-kvm (Ubuntu Lucid):
status: Confirmed → In Progress
assignee: Brian Thomason (brian-thomason) → Dustin Kirkland (kirkland)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qemu-kvm - 0.12.3-0ubuntu6

---------------
qemu-kvm (0.12.3-0ubuntu6) lucid; urgency=low

  [ Dustin Kirkland ]
  * debian/postinst: clean up jaunty-era conffiles on upgrade, LP: #455411
  * debian/links, debian/qemu-kvm-extras.links: install non-x86 arch
    manpages in the qemu-kvm-extras package, LP: #478552

  [ Brian Thomason ]
  * debian/patches/better_describe_-net_options.patch: improve port
    forwarding documentation, LP: #474969, LP: #453617
 -- Dustin Kirkland <email address hidden> Fri, 05 Mar 2010 18:39:19 -0600

Changed in qemu-kvm (Ubuntu Lucid):
status: In Progress → Fix Released
Revision history for this message
Thomas Huth (th-huth) wrote :

Is there still an issue left here with upstream QEMU?

Changed in qemu:
status: Confirmed → Incomplete
Revision history for this message
Thomas Huth (th-huth) wrote :

There hasn't been any comment about upstream QEMU within the last months, so I assume this has been fixed there, too. Closing...

Changed in qemu:
status: Incomplete → 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.