kvm -initrd 'file' dumps core if 'file' does not exist
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qemu-kvm (Ubuntu) |
Fix Released
|
Low
|
Thierry Carrez |
Bug Description
Binary package hint: qemu-kvm
The following crashes
$ k=/boot/
$ i=does-not-exist
$ rm -f ${i}
$ qemu-img create disk.img 1G
$ kvm -kernel ${k} -initrd ${i} -hda disk.img
Aborted (core dumped)
Note the difference from if kernel doesn't exist:
$ kvm -kernel ${i}
qemu: could not load kernel 'does-not-exist': No such file or directory
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: kvm (not installed)
ProcVersionSign
Uname: Linux 2.6.35-14-generic x86_64
Architecture: amd64
Date: Tue Aug 17 11:19:19 2010
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Beta amd64 (20100318)
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
PccardctlIdent:
Socket 0:
no product info available
PccardctlStatus:
Socket 0:
no card
ProcCmdLine: BOOT_IMAGE=
ProcEnviron:
PATH=(custom, user)
LANG=en_US.utf8
SHELL=/bin/bash
SourcePackage: qemu-kvm
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.
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.
dmi.modalias: dmi:bvnLENOVO:
dmi.product.name: 7417CTO
dmi.product.
dmi.sys.vendor: LENOVO
Related branches
Changed in qemu-kvm (Ubuntu): | |
importance: | Undecided → Low |
Changed in qemu-kvm (Ubuntu): | |
status: | New → Confirmed |
Changed in qemu-kvm (Ubuntu): | |
assignee: | nobody → Thierry Carrez (ttx) |
status: | Confirmed → In Progress |
I've done a bit of digging here:
I encounter the issue in both Lucid and Maverick.
gdb on the generated core, w/ a 'bt' shows:
<snip> filename= <value optimised out>, filename= 0x7fff8a0e45d5 "baabaablacksheep", cmdline= <value optimised out>, max_ram_size=<value optimised out>) buildd/ qemu-kvm- 0.12.3+ noroms/ hw/pc.c: 876
#2 0x000000000046f2c5 in oom_check (size=<value optimised out>)
at qemu-malloc.c:30
#3 qemu_malloc (size=<value optimised out>) at qemu-malloc.c:59
#4 0x000000000044a616 in load_linux (fw_cfg=0x275e060,
kernel_
initrd_
kernel_
at /build/
<snip>
hw/pc.c:876 is an attempt to allocate memory for the size of the initrd, the function that calculates the size of the initrd returns '-1' if the file doesn't exist.
Upstream have patched it though to check for an initrd size of -1 and I'm in the process of grabbing the particular change and getting as a diff that could be applied.