Locking fails

Bug #1023159 reported by Wessel Dankers
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qemu-kvm (Ubuntu)
Fix Released
Medium
Unassigned
Precise
Fix Released
Undecided
Unassigned
Quantal
Fix Released
Medium
Unassigned

Bug Description

============================
SRU Justification:
1. Impact: two kvm processes can start (conflicting) with the same pidfile
2. Development fix: keep the pidfile locked for duration of qemu-kvm process
3. Stable fix: same as development fix (cherry-pick the patch)
4. Test case:
  $ kvm -vnc :1 -pidfile abab &
  $ kvm -vnc :2 -pidfile abab
  With the patch, the second kvm will exit with the message:
Could not acquire pid file: Resource temporarily unavailable
  Without the patch the second kvm will run, overwriting the pid of the first.
5. Regression potential: as mentioned in the patch description, coverity may
complain about the open fd being a leak.

============================
The version of qemu-kvm that's in Precise fails to lock the pidfile like it did in all previous versions, possibly leading to data corruption as it might run twice on the same disk images (depending on the configuration).

Upstream has already fixed this bug in http://git.qemu.org/?p=qemu.git;a=commitdiff;h=93dd748b789202af4f5be75412c58ee1ed481b29 (patch attached).

Please apply this patch to the Precise version. Thanks!

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: qemu-kvm 1.0+noroms-0ubuntu13
ProcVersionSignature: Ubuntu 3.2.0-26.41-generic 3.2.19
Uname: Linux 3.2.0-26-generic x86_64
ApportVersion: 2.0.1-0ubuntu8
Architecture: amd64
Date: Tue Jul 10 22:49:05 2012
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
KvmCmdLine: Error: command ['ps', '-C', 'kvm', '-F'] failed with exit code 1: UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
MachineType: Gigabyte Technology Co., Ltd. GA-880GMA-UD2H
ProcEnviron:
 TERM=xterm
 PATH=(custom, user)
 LANG=nl_NL.UTF-8
 SHELL=/bin/zsh
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-26-generic root=/dev/mapper/sys-root ro rw rootflags=logbufs=8,logbsize=256k,noatime,nobarrier hugepages=2060 quiet splash vt.handoff=7
SourcePackage: qemu-kvm
UpgradeStatus: Upgraded to precise on 2012-07-07 (3 days ago)
dmi.bios.date: 06/10/2010
dmi.bios.vendor: Award Software International, Inc.
dmi.bios.version: F3
dmi.board.name: GA-880GMA-UD2H
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: x.x
dmi.chassis.type: 3
dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
dmi.modalias: dmi:bvnAwardSoftwareInternational,Inc.:bvrF3:bd06/10/2010:svnGigabyteTechnologyCo.,Ltd.:pnGA-880GMA-UD2H:pvr:rvnGigabyteTechnologyCo.,Ltd.:rnGA-880GMA-UD2H:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvr:
dmi.product.name: GA-880GMA-UD2H
dmi.sys.vendor: Gigabyte Technology Co., Ltd.

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

Thanks for submitting this bug and including the patch. It is fixed in quantal. I'll SRU the patch you attached for precise-updates.

Changed in qemu-kvm (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
description: updated
Changed in qemu-kvm (Ubuntu Quantal):
status: Triaged → Fix Released
Revision history for this message
Adam Conrad (adconrad) wrote : Please test proposed package

Hello Wessel, or anyone else affected,

Accepted qemu-kvm into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/qemu-kvm/1.0+noroms-0ubuntu14 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in qemu-kvm (Ubuntu Precise):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Wessel Dankers (wsl) wrote :

Tried 1.0+noroms-0ubuntu14 from -proposed and (as far as the locking goes) it works exactly as wished/expected/before. Thanks!

Wessel Dankers (wsl)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qemu-kvm - 1.0+noroms-0ubuntu14

---------------
qemu-kvm (1.0+noroms-0ubuntu14) precise-proposed; urgency=low

  * debian/patches/keep-pid-file-locked.patch: keep pidfile locked for the
    lifetime of the process (LP: #1023159)
 -- Serge Hallyn <email address hidden> Wed, 11 Jul 2012 16:41:05 -0500

Changed in qemu-kvm (Ubuntu Precise):
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.