Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1122408 - qemu-kvm core dump when booting qemu-kvm process with -M Q35 & cores >smp number
Summary: qemu-kvm core dump when booting qemu-kvm process with -M Q35 & cores >smp number
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.1
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: Eduardo Habkost
QA Contact: Virtualization Bugs
Depends On:
Blocks: 1227278
TreeView+ depends on / blocked
Reported: 2014-07-23 07:51 UTC by FuXiangChun
Modified: 2016-05-24 05:40 UTC (History)
8 users (show)

Fixed In Version: qemu-kvm-rhev-2.3.0-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2016-05-24 05:40:14 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description FuXiangChun 2014-07-23 07:51:54 UTC
Description of problem:
e.g. /usr/libexec/qemu-kvm -M q35 -m 4G -smp 1,sockets=1,threads=1,cores=2
core=2 >smp 1.  it will cause qemu-kvm core dump.  If cores number <=smp number then qemu-kvm works well.

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

How reproducible:

Steps to Reproduce:
1.Boot qemu-kvm process with cores number > smp number.
/usr/libexec/qemu-kvm -M q35 -m 4G -smp 1,sockets=1,threads=1,cores=2

Actual results:
(gdb) bt
#0  0x00007ffff24d4989 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff24d6098 in __GI_abort () at abort.c:90
#2  0x00007ffff24cd8f6 in __assert_fail_base (fmt=0x7ffff261d3e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x5555558a2c07 "smbios_smp_sockets >= 1", 
    file=file@entry=0x5555558a2ac0 "/builddir/build/BUILD/qemu-2.1.0/hw/i386/smbios.c", line=line@entry=826, 
    function=function@entry=0x5555558a2ea0 <__PRETTY_FUNCTION__.28490> "smbios_get_tables") at assert.c:92
#3  0x00007ffff24cd9a2 in __GI___assert_fail (assertion=assertion@entry=0x5555558a2c07 "smbios_smp_sockets >= 1", 
    file=file@entry=0x5555558a2ac0 "/builddir/build/BUILD/qemu-2.1.0/hw/i386/smbios.c", line=line@entry=826, 
    function=function@entry=0x5555558a2ea0 <__PRETTY_FUNCTION__.28490> "smbios_get_tables") at assert.c:101
#4  0x0000555555684af6 in smbios_get_tables (tables=tables@entry=0x7fffffffe0e8, tables_len=tables_len@entry=0x7fffffffe0f8, 
    anchor=anchor@entry=0x7fffffffe0f0, anchor_len=anchor_len@entry=0x7fffffffe100) at /usr/src/debug/qemu-2.1.0/hw/i386/smbios.c:826
#5  0x0000555555687a29 in bochs_bios_init () at /usr/src/debug/qemu-2.1.0/hw/i386/pc.c:683
#6  pc_memory_init (machine=machine@entry=0x555556164e40, system_memory=0x555556165d70, 
    below_4g_mem_size=below_4g_mem_size@entry=2147483648, above_4g_mem_size=above_4g_mem_size@entry=2147483648, 
    rom_memory=rom_memory@entry=0x5555561703f0, ram_memory=ram_memory@entry=0x7fffffffe190, 
    guest_info=guest_info@entry=0x55555616ff80) at /usr/src/debug/qemu-2.1.0/hw/i386/pc.c:1283
#7  0x0000555555689984 in pc_q35_init (machine=0x555556164e40) at /usr/src/debug/qemu-2.1.0/hw/i386/pc_q35.c:166
#8  pc_q35_init_rhel700 (machine=0x555556164e40) at /usr/src/debug/qemu-2.1.0/hw/i386/pc_q35.c:464
#9  0x000055555561c773 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4410

Expected results:
qemu-kvm works well. if qemu-kvm don't support this scenarios. should print a warning message(shouldn't core dump)

Additional info:
1.If need full core file.  QE will update it asap. 

2.-M pc don't hit this issue.

Comment 3 Eduardo Habkost 2015-07-03 17:45:38 UTC
Fixed on the 2.3.0 rebased, by commit:

commit 7dfddd7f884b6dd2abf230d8fa6c7c83aab4f5ec
Author: Eduardo Habkost <ehabkost@redhat.com>
Date:   Mon Sep 29 22:21:45 2014 -0300

    smbios: Fix assertion on socket count calculation
    QEMU currently allows the number of VCPUs to not be a multiple of the
    number of threads per socket, but the smbios socket count calculation
    introduced by commit c97294ec1b9e36887e119589d456557d72ab37b5 doesn't
    take that into account, triggering an assertion. e.g.:
      $ ./x86_64-softmmu/qemu-system-x86_64 -smp 4,sockets=2,cores=6,threads=1
      qemu-system-x86_64: /home/ehabkost/rh/proj/virt/qemu/hw/i386/smbios.c:825: smbios_get_tables: Assertion `smbios_smp_sockets >= 1' failed.
      Aborted (core dumped)
    Socket count calculation doesn't belong to smbios.c and should
    eventually be moved to the main SMP topology configuration code. But
    while we don't move the code, at least make it correct by rounding up
    the division.

Comment 4 Yanhui Ma 2015-07-28 08:53:38 UTC
qemu-kvm-rhev older than qemu-kvm-rhev-2.1.2-21.el7.x86_64 has been deleted in http://brewweb.devel.redhat.com/.

qemu-kvm-rhev-2.1.2-21.el7.x86_64 can not hit the issue. So the issue doesn't be reproduced.

verify the issue

host info


1.Boot qemu-kvm process with cores number > smp number.
/usr/libexec/qemu-kvm -M q35 -m 4G -smp 1,sockets=1,threads=1,cores=2

qemu-kvm works well. 
Based on the above result, I think the bug has been fixed.

Comment 5 juzhang 2015-08-03 04:13:42 UTC
According to comment4, set this issue as verified.

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