'qemu-img snapshot' crashed, corrupting disk image

Bug #442598 reported by Nelson Elhage
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
qemu-kvm (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: qemu-kvm

I have a 10GB qcow2 disk image that I use for testing various things on a clean Jaunty install. I created it with the qemu package from Jaunty, and it has been working fine for some time.

I recently upgraded to Karmic, and, after doing some work in the VM, attempting to snapshot the VM using 'qemu-img snapshot -c test jaunty.qcow2'. After a minute or so, qemu-img had grown to consume nearly all of my 2GB of RAM, and then, after another minute or two, terminated with a segfault. After this crash, all attempts to use the disk image, either via qemu-img or booting it in qemu or kvm have resulted in a segfault.

I can generate core files of the later crashes, but since qemu uses most of my RAM before crashing, they are quite large (1.5+GB). Please let me know if extracting backtraces or other information would be useful, or if I should post a core image somewhere anyways for a developer to attempt to download it.

ProblemType: Bug
Architecture: i386
Date: Sun Oct 4 17:22:31 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 2613CTO
Package: qemu-kvm 0.11.0-0ubuntu1
PccardctlIdent:
 Socket 0:
   no product info available
PccardctlStatus:
 Socket 0:
   no card
ProcCmdLine: root=UUID=f9f53a9f-164b-4f56-aa03-d28ca7084928 ro quiet splash
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-11.38-generic
SourcePackage: qemu-kvm
Uname: Linux 2.6.31-11-generic i686
dmi.bios.date: 11/20/2006
dmi.bios.vendor: LENOVO
dmi.bios.version: 79ETC6WW (2.06 )
dmi.board.name: 2613CTO
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:bvr79ETC6WW(2.06):bd11/20/2006:svnLENOVO:pn2613CTO:pvrThinkPadT60:rvnLENOVO:rn2613CTO:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
dmi.product.name: 2613CTO
dmi.product.version: ThinkPad T60
dmi.sys.vendor: LENOVO

Revision history for this message
Nelson Elhage (nelhage) wrote :
Revision history for this message
Nelson Elhage (nelhage) wrote :

Actually, the core files in question compress down quite nicely, so find attached a 1.6M core.gz file from a crashed 'qemu-snapshot -l jaunty.qcow2'.

Be warned that it expands into a 1.6GB file.

Changed in qemu-kvm (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
stefan.kamien (stefan-kamien) wrote :

It seems that I also experienced this bug.

I installed qemu-kvm package on Ubuntu 9.10. I did following:

qemu-img create -f qcow2 disc 10G

qemu -hda disc -cdrom /dev/cdrom -m 512

Then i installed quest OS (Windows XP). I shut down VM and booted again, without cdrom:

qemu -hda disc -m 512

After windows booted and I logged in, I did ctrl+alt+2
and i entered following command in qemu monitor:
savevm john

Then Qemu quits automaticallly, and it says "Segmentation fault" in hosts command line. I was trying to load that snapshot by typing:
qemu -hda disc -m 512 -loadvm john

This command should start qemu and load saved vm state with all running apps right? In my case it only started qemu and booted windows.

I tried also in qemu monitor:
loadvm john
but it says "Could not find snapshot 'john' on device 'ide0-hd0'.
Typing "info snapshots" in qemu monitor doesnt show any avaible snapshot.
Sorry for poor english language.

Revision history for this message
stefan.kamien (stefan-kamien) wrote :

Hi again. Sorry if my previous comment is not related to your bug. I didnt read your description carefully and I'm new to launchpad. Do you think that I should report separate bug?

Revision history for this message
Torsten Spindler (tspindler) wrote :

The following command did not give an error for me on Lucid Alpha 3, 2010-03-01 updates installed:
$ qemu-img snapshot -c toast ./lucid.qcow2
Version: 0.12.3-0ubuntu2

Unfortunately I did not find a snapshot thereafter either.

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

Hmm, I booted a vm, dropped to the QEMU console, and tried savevm, which appeared to result in a hung vm.

There seems to be at least something wrong with image snapshotting in Lucid. I'll confirm this for now.

Changed in qemu-kvm (Ubuntu):
status: Triaged → Confirmed
Revision history for this message
Anthony Liguori (anthony-codemonkey) wrote :

qemu-img snapshot and savevm are different mechanisms. I'd suggest closing this bug and opening a separate one for savevm.

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

Gotcha. My methods were flawed. Closing bug per Torsten's feedback. Please reopen if you can reproduce this on latest Lucid.

Thanks!

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

Actually I tested savevm too, and that seems to work as well. Here's how, for completeness...

$ kvm-img create -f qcow2 foo.img 4G
Formatting 'foo.img', fmt=qcow2 size=4294967296 encryption=off cluster_size=0

$ kvm -m 512 -cdrom lucid-desktop-amd64.iso -hda foo.img

At some point here (even during boot), drop to monitor
ctrl-alt-2
savevm foo.img

You can watch the image grow as memory is written:
$ watch ls -alF foo.img

Once it's done, go back to the vga with ctrl-alt-1. Change the system somehow. Then roll back with
ctrl-alt-2
loadvm foo.img

Worked well for me.

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.