Bug 516543 - qemu-kvm segfaults when run inside another virtual machine
qemu-kvm segfaults when run inside another virtual machine
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: qemu (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Richard W.M. Jones
Fedora Extras Quality Assurance
:
Depends On:
Blocks: F12VirtTarget
  Show dependency treegraph
 
Reported: 2009-08-10 07:35 EDT by Richard W.M. Jones
Modified: 2009-08-21 04:56 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-08-21 04:56:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Richard W.M. Jones 2009-08-10 07:35:06 EDT
Description of problem:

qemu-kvm segfaults when run from inside another virtual machine.
For example (from inside a KVM VM):

$ qemu-kvm -hda /dev/zero -nographic
open /dev/kvm: No such file or directory
Could not initialize KVM, will disable KVM support
Segmentation fault

The same command on baremetal does not segfault.

Version-Release number of selected component (if applicable):

qemu-system-x86-0.10.91-0.5.rc1.fc12.x86_64

How reproducible:

Always.

Steps to Reproduce:
1. Run qemu-kvm in a KVM or Xen VM.
2. Segfaults.
3.
Comment 1 Richard W.M. Jones 2009-08-10 07:36:23 EDT
This affects 'make check' in libguestfs, for example:
http://koji.fedoraproject.org/koji/getfile?taskID=1588660&name=build.log
Comment 2 Mark McLoughlin 2009-08-10 07:40:42 EDT
Could you get a stack trace?
Comment 3 Richard W.M. Jones 2009-08-10 07:41:18 EDT
Sure can ...

Program received signal SIGSEGV, Segmentation fault.
tb_gen_code (env=0x20b9860, pc=4294967280, cs_base=4294901760, flags=68, 
    cflags=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.11.0-rc1/exec.c:901
901	    tb->tc_ptr = tc_ptr;
Missing separate debuginfos, use: debuginfo-install dbus-libs-1.2.16-4.fc12.x86_64 libICE-1.0.4-9.fc12.x86_64 libSM-1.1.0-7.fc12.x86_64 libXau-1.0.4-7.fc12.x86_64 libXext-1.0.99.4-3.fc12.x86_64 libXi-1.2.99-10.20090805.fc12.x86_64 libXtst-1.0.99.1-3.fc12.x86_64 libasyncns-0.7-3.fc12.x86_64 libattr-2.4.43-4.fc12.x86_64 libcap-2.16-5.fc12.x86_64 libgcrypt-1.4.4-7.fc12.x86_64 libgpg-error-1.6-4.x86_64 libsndfile-1.0.20-2.fc12.x86_64 libtasn1-2.2-2.fc12.x86_64 libuuid-2.16-3.fc12.x86_64 libxcb-1.3-2.fc12.x86_64 nss-mdns-0.10-8.fc12.x86_64 nss-softokn-freebl-3.12.3.99.3-6.fc12.x86_64 tcp_wrappers-libs-7.6-56.fc12.x86_64
(gdb) bt
#0  tb_gen_code (env=0x20b9860, pc=4294967280, cs_base=4294901760, flags=68, 
    cflags=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.11.0-rc1/exec.c:901
#1  0x00000000004de106 in tb_find_slow (flags=<value optimized out>, 
    cs_base=<value optimized out>, pc=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.11.0-rc1/cpu-exec.c:168
#2  tb_find_fast (flags=<value optimized out>, cs_base=<value optimized out>, 
    pc=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.11.0-rc1/cpu-exec.c:189
#3  cpu_x86_exec (flags=<value optimized out>, cs_base=<value optimized out>, 
    pc=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.11.0-rc1/cpu-exec.c:614
#4  0x000000000040eea2 in qemu_cpu_exec (env=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.11.0-rc1/vl.c:4262
#5  tcg_cpu_exec (env=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.11.0-rc1/vl.c:4293
#6  main_loop (env=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.11.0-rc1/vl.c:4412
#7  main (env=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.11.0-rc1/vl.c:6271
(gdb) quit
Comment 4 Mark McLoughlin 2009-08-10 11:38:29 EDT
Lovely, a TCG bug

Should be easy enough to bisect ...
Comment 5 Richard W.M. Jones 2009-08-20 04:37:22 EDT
Just note that this still happens with 0.10.91-0.7.rc1

I will try to bisect it.
Comment 7 Richard W.M. Jones 2009-08-20 09:42:37 EDT
http://koji.fedoraproject.org/koji/taskinfo?taskID=1617421

Requested this be pushed into Fedora 12 Alpha:
https://fedorahosted.org/rel-eng/ticket/2132
Comment 8 Mark McLoughlin 2009-08-21 04:56:36 EDT
Alpha is finished, but the fix is in rawhide now

Note You need to log in before you can comment on or make changes to this bug.