Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1447210

Summary: [RHEV7.4] process guest memory dump file with crash, crash vmlinux dump.normal do not match
Product: Red Hat Enterprise Linux 7 Reporter: hachen <hachen>
Component: qemu-kvm-rhevAssignee: Ademar Reis <areis>
Status: CLOSED DUPLICATE QA Contact: hachen <hachen>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: aliang, chayang, coli, hachen, jdenemar, juzhang, knoel, lwang, marcandre.lureau, michen, ngu, pingl, rbalakri, ruyang, shuang, virt-maint, xuhan, xuwei
Target Milestone: rcKeywords: TestBlocker
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-04 02:44:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description hachen 2017-05-02 06:33:59 UTC
Description of problem:
I am not sure if it is a kexec bug or qemu bug, but it might be a kexec one.
So I list all the info here. 
Please correct me if my steps are wrong.

qemu:
WARNING: failed to init kexec backup region
WARNING: cannot read linux_banner string
crash: /usr/lib/debug/lib/modules/3.10.0-656.el7.x86_64/vmlinux and /home/dump.normal do not match!

libvirt:
WARNING: failed to init kexec backup region
crash: read error: kernel virtual address: ffffffff00000020  type: "active"
WARNING: cannot read cpu_active_map
crash: cannot determine base kernel version
crash: /usr/lib/debug/lib/modules/3.10.0-656.el7.x86_64/vmlinux and /var/lib/libvirt/qemu/dump/1-rhel7.3-min-2017-05-02-01:57:46 do not match!



Version-Release number of selected component (if applicable):
HOST:
kernel-3.10.0-656.el7.x86_64
kernel-debuginfo-3.10.0-656.el7.x86_64
kernel-debuginfo-common-x86_64-3.10.0-656.el7.x86_64

kexec-tools-2.0.14-3.el7.x86_64
qemu-img-rhev-2.9.0-1.el7.x86_64
crash 7.1.9-1.el7

Guest:
kernel-debuginfo-3.10.0-656.el7.x86_64
kernel-headers-3.10.0-656.el7.x86_64
kernel-3.10.0-656.el7.x86_64
kernel-debuginfo-common-x86_64-3.10.0-656.el7.x86_64


How reproducible: always


Steps to Reproduce:
1.Start a guest
/usr/libexec/qemu-kvm \
    -name 'avocado-vt-vm1'  \
    -sandbox off  \
    -machine pc  \
    -nodefaults  \
    -vga cirrus  \
    -device pvpanic,ioport=0x505,id=idHT1RPm  \
    -device ich9-usb-ehci1,id=usb1,addr=0x1d.7,multifunction=on,bus=pci.0 \
    -device ich9-usb-uhci1,id=usb1.0,multifunction=on,masterbus=usb1.0,addr=0x1d.0,firstport=0,bus=pci.0 \
    -device ich9-usb-uhci2,id=usb1.1,multifunction=on,masterbus=usb1.0,addr=0x1d.2,firstport=2,bus=pci.0 \
    -device ich9-usb-uhci3,id=usb1.2,multifunction=on,masterbus=usb1.0,addr=0x1d.4,firstport=4,bus=pci.0 \
    -drive id=drive_image1,if=none,snapshot=off,aio=native,cache=none,format=qcow2,file=/home/kvm_autotest_root/images/rhel74-64-virtio.qcow2 \
    -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,bus=pci.0,addr=0x3 \
    -device virtio-net-pci,mac=9a:1b:1c:1d:1e:1f,id=id8xeo6O,vectors=4,netdev=idBP1nUD,bus=pci.0,addr=0x4  \
    -netdev tap,id=idBP1nUD \
    -m 4G  \
    -smp 4,cores=2,threads=1,sockets=2  \
    -cpu 'Westmere',+kvm_pv_unhalt \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -vnc :0  \
    -rtc base=utc,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off,strict=off \
    -enable-kvm \
    -monitor stdio \
    -qmp tcp:localhost:4444,server,nowait \

2.Check dump-guest-memory command.
QMP:
{ "execute": "qmp_capabilities" }
{"return": {}}
{"execute": "dump-guest-memory", "arguments": { "paging": false, "protocol": "file:/home/dump.normal"}}

# crash /usr/lib/debug/lib/modules/3.10.0-656.el7.x86_64/vmlinux /home/dump.normal

Actual results:
crash 7.1.9-1.el7
Copyright (C) 2002-2016  Red Hat, Inc.
Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation
Copyright (C) 1999-2006  Hewlett-Packard Co
Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited
Copyright (C) 2006, 2007  VA Linux Systems Japan K.K.
Copyright (C) 2005, 2011  NEC Corporation
Copyright (C) 1999, 2002, 2007  Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux, Inc.
This program is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions.  Enter "help copying" to see the conditions.
This program has absolutely no warranty.  Enter "help warranty" for details.
 
WARNING: cannot determine physical base address: defaulting to 0

GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu"...

WARNING: failed to init kexec backup region
WARNING: cannot read linux_banner string
crash: /usr/lib/debug/lib/modules/3.10.0-656.el7.x86_64/vmlinux and /home/dump.normal do not match!

Usage:

  crash [OPTION]... NAMELIST MEMORY-IMAGE[@ADDRESS]	(dumpfile form)
  crash [OPTION]... [NAMELIST]             		(live system form)

Enter "crash -h" for details.


Expected results:
open the dump file correctly.

Additional info:

Comment 2 hachen 2017-05-02 06:37:08 UTC
I tested it on qemu-img-rhev-2.8.0-5.el7.x86_64
The rest are same:
HOST:
kernel-3.10.0-656.el7.x86_64
kernel-debuginfo-3.10.0-656.el7.x86_64
kernel-debuginfo-common-x86_64-3.10.0-656.el7.x86_64

kexec-tools-2.0.14-3.el7.x86_64
crash 7.1.9-1.el7

Guest:
kernel-debuginfo-3.10.0-656.el7.x86_64
kernel-headers-3.10.0-656.el7.x86_64
kernel-3.10.0-656.el7.x86_64
kernel-debuginfo-common-x86_64-3.10.0-656.el7.x86_64

Got the same result in the #Description

Comment 3 hachen 2017-05-02 06:44:57 UTC
Then I tried it with libvirt:
libvirt-3.2.0-3.el7.x86_64
qemu-kvm-rhev-2.9.0-1.el7

The rest are same as the description.

1. start guest:
<domain type='kvm'>
  <name>rhel7.3-min</name>
  <uuid>1b3268d6-b59c-406b-a14c-33b000b15b6c</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static' cpuset='0-3'>15</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.4.0'>hvm</type>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pmu state='on'/>
  </features>
  <clock offset='utc'>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>coredump-restart</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='yes'/>
  </pm>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/home/kvm_autotest_root/images/rhel74-64-virtio.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </disk>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='scsi' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:a5:95:16'/>
      <source network='default'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='1' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
        <panic model='hyperv'/>
    <panic model='isa'>
      <address type='isa' iobase='0x505'/>
    </panic>
  </devices>
</domain>


2.Trigger guest coredump in the guest
 # echo c >/proc/sysrq-trigger

3.Check the crash file automatically created in host.
#  ls -lh /var/lib/libvirt/qemu/dump/1-rhel7.3-min-2017-05-02-01\:57\:46 
-rw------- 1 root root 1.1G May  2 01:57 /var/lib/libvirt/qemu/dump/1-rhel7.3-min-2017-05-02-01:57:46

# crash /usr/lib/debug/lib/modules/`uname -r`/vmlinux /var/lib/libvirt/qemu/dump/1-rhel7.3-min-2017-05-02-01\:57\:46 

I got :crash 7.1.9-1.el7
Copyright (C) 2002-2016  Red Hat, Inc.
Copyright (C) 2004, 2005, 2006, 2010  IBM Corporation
Copyright (C) 1999-2006  Hewlett-Packard Co
Copyright (C) 2005, 2006, 2011, 2012  Fujitsu Limited
Copyright (C) 2006, 2007  VA Linux Systems Japan K.K.
Copyright (C) 2005, 2011  NEC Corporation
Copyright (C) 1999, 2002, 2007  Silicon Graphics, Inc.
Copyright (C) 1999, 2000, 2001, 2002  Mission Critical Linux, Inc.
This program is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it under
certain conditions.  Enter "help copying" to see the conditions.
This program has absolutely no warranty.  Enter "help warranty" for details.
 
WARNING: cannot determine physical base address: defaulting to 0

GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu"...

WARNING: failed to init kexec backup region
crash: read error: kernel virtual address: ffffffff00000020  type: "active"
WARNING: cannot read cpu_active_map
crash: cannot determine base kernel version
crash: /usr/lib/debug/lib/modules/3.10.0-656.el7.x86_64/vmlinux and /var/lib/libvirt/qemu/dump/1-rhel7.3-min-2017-05-02-01:57:46 do not match!

Usage:

  crash [OPTION]... NAMELIST MEMORY-IMAGE[@ADDRESS]	(dumpfile form)
  crash [OPTION]... [NAMELIST]             		(live system form)

Enter "crash -h" for details.

Comment 4 Dave Anderson 2017-05-02 13:16:27 UTC
libvirt dumpfile creation does not support KASLR kernels (such as
3.10.0-656.el7 in this case).  There are a few existing bugzillas
addressing this, but I'm not sure which one this bugzilla should be
a duplicate of, so just reassigning the component to libvirt.

Comment 10 Ademar Reis 2017-05-04 02:44:05 UTC
As pointed out by Dave, this is a duplicate of Bug 1398633.

KASLR support is not ready for qemu-kvm-rhev (discussing it upstream). It won't be included in RHEL-7.4.

*** This bug has been marked as a duplicate of bug 1398633 ***