Bug 628855

Summary: [abrt] qemu-system-x86-2:0.12.5-1.fc13: raise: Process /usr/bin/qemu-kvm was killed by signal 6 (SIGABRT)
Product: [Fedora] Fedora Reporter: Niels de Vos <ndevos>
Component: qemuAssignee: Justin M. Forbes <jforbes>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: amit.shah, berrange, dev, dwmw2, ehabkost, gcosta, itamar, jaswinder, jforbes, knoel, markmc, ondrejj, scottt.tw, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: abrt_hash:4289796d9772ed31732becbddf27ab89acd3ef7d
Fixed In Version: qemu-system-x86-0.13.0-1.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-05 20:23:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace none

Description Niels de Vos 2010-08-31 08:23:19 UTC
abrt version: 1.1.13
architecture: x86_64
Attached file: backtrace
cmdline: qemu-kvm -kernel /boot/vmlinuz-2.6.33.8-149.fc13.x86_64 -initrd file-that-does-not-exist -hda disk.img
component: qemu
crash_function: raise
executable: /usr/bin/qemu-kvm
kernel: 2.6.33.8-149.fc13.x86_64
package: qemu-system-x86-2:0.12.5-1.fc13
rating: 4
reason: Process /usr/bin/qemu-kvm was killed by signal 6 (SIGABRT)
release: Fedora release 13 (Goddard)
time: 1283241054
uid: 501

comment
-----
Attributing to Nigel Jones who pointed this issue out to me.

Fixed upstream:

$ git format-patch --stdout -n1 d6fa4b77
From d6fa4b77fb8f27ac84cf23fb1e15016673d98a47 Mon Sep 17 00:00:00 2001
From: M. Mohan Kumar <mohan.com>
Date: Mon, 12 Apr 2010 10:01:33 +0530
Subject: [PATCH 1/1] Check for invalid initrd file

When qemu is invoked with an invalid initrd file, it crashes. Following
patch prints a error message and exits if an invalid initrd is
specified. Includes changes suggested by JV.

Signed-off-by: M. Mohan Kumar <mohan.com>
Signed-off-by: Aurelien Jarno <aurelien>
---
 hw/pc.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 69e597f..b797f21 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -658,6 +658,12 @@ static void load_linux(void *fw_cfg,
 	}
 
 	initrd_size = get_image_size(initrd_filename);
+        if (initrd_size < 0) {
+            fprintf(stderr, "qemu: error reading initrd %s\n",
+                    initrd_filename);
+            exit(1);
+        }
+
         initrd_addr = (initrd_max-initrd_size) & ~4095;
 
         initrd_data = qemu_malloc(initrd_size);
-- 
1.7.2.2


How to reproduce
-----
1. qemu-img create disk.img 1G
2. kvm -kernel /boot/vmlinuz-2.6.33.8-149.fc13.x86_64 -initrd file-that-does-not-exist -hda disk.img

Comment 1 Niels de Vos 2010-08-31 08:23:23 UTC
Created an attachment (id=442131)
File: backtrace

Comment 2 Niels de Vos 2010-11-05 20:23:35 UTC
Tested under Fedora 14 and seems to be fixed.

$ qemu-kvm -kernel /boot/vmlinuz-2.6.35.6-48.fc14.x86_64 -initrd /path/to/non/existing/file -hda disk.img 
qemu: error reading initrd /path/to/non/existing/file