Bug 2018367

Summary: Qemu core dumped when do blockdev-mirror during the guest os installing process
Product: Red Hat Enterprise Linux 8 Reporter: Gu Nini <ngu>
Component: qemu-kvmAssignee: Stefano Garzarella <sgarzare>
qemu-kvm sub component: Block Jobs QA Contact: Gu Nini <ngu>
Status: CLOSED DUPLICATE Docs Contact:
Severity: high    
Priority: high CC: aliang, jinzhao, kkiwi, lijin, virt-maint
Version: 8.6Keywords: Regression
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-02 01:55:45 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:
Bug Depends On: 2001404    
Bug Blocks:    

Description Gu Nini 2021-10-29 03:12:53 UTC
Description of problem:
On RHEL8.6 host, install a guest with a RHEL8.6.0 iso; when the guest is under installing, do blockdev-mirror for the system disk, the qemu core dumped:

# sh vm1.sh
QEMU 6.1.0 monitor - type 'help' for more information
(qemu) qemu-kvm: warning: kernel_irqchip allowed but unavailable: IRQ_XIVE capability must be present for KVM
Falling back to kernel-irqchip=off

(qemu) 
(qemu) 
(qemu) vm1.sh: line 31: 769903 Segmentation fault      (core dumped) /usr/libexec/qemu-kvm -name 'avocado-vt-vm1' -sandbox on -machine pseries -nodefaults -device VGA,bus=pci.0,addr=0x2 -m 2048 -smp 8,maxcpus=8,cores=4,threads=1,sockets=2 -cpu 'host' -chardev socket,id=qmp_id_qmpmonitor1,server=on,wait=off,path=/var/tmp/avocado_1 -mon chardev=qmp_id_qmpmonitor1,mode=control -chardev socket,id=chardev_serial0,server=on,wait=off,path=/var/tmp/avocado_2 -device spapr-vty,id=serial0,reg=0x30000000,chardev=chardev_serial0 -device qemu-xhci,id=usb1,bus=pci.0,addr=0x3 -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x4 -blockdev node-name=file_image1,driver=file,aio=threads,filename=/home/ngu/rhel860-ppc64le-virtio-scsi.qcow2,auto-read-only=on,cache.direct=on,cache.no-flush=off -blockdev node-name=drive_image1,driver=qcow2,cache.direct=on,cache.no-flush=off,file=file_image1 -device scsi-hd,id=image1,drive=drive_image1,write-cache=on -blockdev node-name=file_cd1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/ngu/kar/workspace/root/avocado/data/avocado-vt/isos/linux/RHEL-8.6.0-20211027.3-ppc64le-dvd1.iso,cache.direct=on,cache.no-flush=off -blockdev node-name=drive_cd1,driver=raw,read-only=on,cache.direct=on,cache.no-flush=off,file=file_cd1 -device scsi-cd,id=cd1,drive=drive_cd1,write-cache=on -device virtio-net-pci,mac=9a:fa:14:5e:3d:13,id=idLviSMj,netdev=idlrY22o,bus=pci.0,addr=0x5 -netdev tap,id=idlrY22o,vhost=on -vnc :0 -rtc base=utc,clock=host -boot menu=off,order=cdn,once=d,strict=off -enable-kvm -monitor stdio -device spapr-vscsi,id=scsi0,reg=0x00002000


Version-Release number of selected component (if applicable):
Host kernel: 4.18.0-348.3.el8.ppc64le
Guest installation iso: RHEL-8.6.0-20211027.3-ppc64le-dvd1.iso
Qemu: qemu-kvm-6.1.0-4.module+el8.6.0+13039+4b81a1dc.ppc64le

How reproducible:
100%

Steps to Reproduce:
1. Boot up a guest and install os on the system image with an iso:

    -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x4 \
    -blockdev node-name=file_image1,driver=file,aio=threads,filename=/home/ngu/rhel860-ppc64le-virtio-scsi.qcow2,auto-read-only=on,cache.direct=on,cache.no-flush=off \
    -blockdev node-name=drive_image1,driver=qcow2,cache.direct=on,cache.no-flush=off,file=file_image1 \
    -device scsi-hd,id=image1,drive=drive_image1,write-cache=on \
    -blockdev node-name=file_cd1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/ngu/kar/workspace/root/avocado/data/avocado-vt/isos/linux/RHEL-8.6.0-20211027.3-ppc64le-dvd1.iso,cache.direct=on,cache.no-flush=off \
    -blockdev node-name=drive_cd1,driver=raw,read-only=on,cache.direct=on,cache.no-flush=off,file=file_cd1 \
    -device scsi-cd,id=cd1,drive=drive_cd1,write-cache=on \

2. When the guest in under installing, do blockdev-mirror for the system disk:

{"execute": "blockdev-create", "arguments": {"options": {"driver": "file", "filename": "/home/ngu/mirror1.qcow2", "size": 21474836480}, "job-id": "file_mirror1"}, "id": "fbLWddmq"}
{"execute": "job-dismiss", "arguments": {"id": "file_mirror1"}, "id": "3E4YRekQ"}
{"execute": "blockdev-add", "arguments": {"node-name": "file_mirror1", "driver": "file", "filename": "/home/ngu/mirror1.qcow2", "aio": "threads", "auto-read-only": true, "discard": "unmap"}, "id": "jupv6wNa"}
{"execute": "blockdev-create", "arguments": {"options": {"driver": "qcow2", "file": "file_mirror1", "size": 21474836480}, "job-id": "drive_mirror1"}, "id": "gq4DbQTE"}
{"execute": "job-dismiss", "arguments": {"id": "drive_mirror1"}, "id": "zNuHK089"}
{"execute": "blockdev-add", "arguments": {"node-name": "drive_mirror1", "driver": "qcow2", "file": "file_mirror1", "read-only": false}, "id": "MdjFR9Qz"}
{"execute": "blockdev-mirror", "arguments": {"sync": "full", "device": "drive_image1", "target": "drive_mirror1", "job-id": "drive_image1_QVWZ"}, "id": "l2dmHMxm"}

Actual results:
In step2, after the mirror job getting ready status, qemu core dump occurred:

{"execute": "blockdev-mirror", "arguments": {"sync": "full", "device": "drive_image1", "target": "drive_mirror1", "job-id": "drive_image1_QVWZ"}, "id": "l2dmHMxm"}
{"timestamp": {"seconds": 1635472957, "microseconds": 357739}, "event": "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "drive_image1_QVWZ"}}
{"timestamp": {"seconds": 1635472957, "microseconds": 357811}, "event": "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "drive_image1_QVWZ"}}
{"return": {}, "id": "l2dmHMxm"}


{"timestamp": {"seconds": 1635472960, "microseconds": 386619}, "event": "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "drive_image1_QVWZ"}}
{"timestamp": {"seconds": 1635472960, "microseconds": 386666}, "event": "BLOCK_JOB_READY", "data": {"device": "drive_image1_QVWZ", "len": 21474836480, "offset": 21474836480, "speed": 0, "type": "mirror"}}

Ncat: Broken pipe.

Expected results:
The mirror job could continue until it finishes.

Additional info:

Comment 2 Gu Nini 2021-10-29 10:37:06 UTC
Failed to reproduce the bug on qemu-kvm-6.0.0-33.module+el8.5.0+13041+05be2dc6.ppc64le, so this bug is a regression.

Also this bug could be reproduced on qemu-kvm-6.1.0-4.module+el8.6.0+13039+4b81a1dc.x86_64 with the same step. So this should be the same issue of bz2001404 on RHEL9. Sorry, I had not noticed there was already a bug reported on RHEL9 when I reported the bug, suggest to leave it as a tracker since we have decided to rebase it for RHEL8.6.

Comment 3 Klaus Heinrich Kiwi 2021-11-01 10:56:45 UTC
(In reply to Gu Nini from comment #2)
> Failed to reproduce the bug on
> qemu-kvm-6.0.0-33.module+el8.5.0+13041+05be2dc6.ppc64le, so this bug is a
> regression.
> 
> Also this bug could be reproduced on
> qemu-kvm-6.1.0-4.module+el8.6.0+13039+4b81a1dc.x86_64 with the same step. So
> this should be the same issue of bz2001404 on RHEL9. Sorry, I had not
> noticed there was already a bug reported on RHEL9 when I reported the bug,
> suggest to leave it as a tracker since we have decided to rebase it for
> RHEL8.6.

Stefano, can you take a look?

Comment 4 aihua liang 2021-11-02 01:38:26 UTC
(In reply to Gu Nini from comment #2)
> Failed to reproduce the bug on
> qemu-kvm-6.0.0-33.module+el8.5.0+13041+05be2dc6.ppc64le, so this bug is a
> regression.
> 
> Also this bug could be reproduced on
> qemu-kvm-6.1.0-4.module+el8.6.0+13039+4b81a1dc.x86_64 with the same step. So
> this should be the same issue of bz2001404 on RHEL9. Sorry, I had not
> noticed there was already a bug reported on RHEL9 when I reported the bug,
> suggest to leave it as a tracker since we have decided to rebase it for
> RHEL8.6.

Post bug in RHEL8:
 https://bugzilla.redhat.com/show_bug.cgi?id=2002607

Comment 5 Gu Nini 2021-11-02 01:55:45 UTC

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