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 1392287 - Core dump occurs when query qtree after migration with "-vga cirrus"
Summary: Core dump occurs when query qtree after migration with "-vga cirrus"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.8
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Ladi Prosek
QA Contact: xianwang
URL:
Whiteboard:
Depends On: 1294941
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-07 06:36 UTC by lijin
Modified: 2017-03-21 09:40 UTC (History)
14 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.497.el6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-21 09:40:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:0621 0 normal SHIPPED_LIVE Moderate: qemu-kvm security and bug fix update 2017-03-21 12:28:31 UTC

Description lijin 2016-11-07 06:36:05 UTC
Description of problem:
query qtree in qemu monitor after migration,

Version-Release number of selected component (if applicable):
kernel-2.6.32-667.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.495.el6.x86_64
seabios-0.6.1.2-30.el6.x86_64
virtio-win-1.8.0-1.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1.boot win2016 guest with -vga cirrus:
/usr/libexec/qemu-kvm -cpu SandyBridge -name 122BLKWIN2016 -enable-kvm -m 8G -smp 4 -nodefconfig -nodefaults -rtc base=localtime,driftfix=slew -boot order=cd,menu=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=win2016.raw,if=none,id=drive-ide0-0-0,format=raw,serial=mike_cao,cache=none -device ide-drive,drive=drive-ide0-0-0,id=ide0-0-0 -drive file=en_windows_server_2016_x64_dvd_9327751.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,drive=drive-ide0-1-0,id=ide0-1-0,bus=ide.0,unit=1 -netdev tap,script=/etc/qemu-ifup,downscript=no,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=00:52:4c:00:8d:a7 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=isa_serial0 -device usb-tablet,id=input0 -vnc 0.0.0.0:0 -vga cirrus -cdrom /usr/share/virtio-win/virtio-win.iso -monitor stdio -qmp tcp:0:4444,server,nowait -device virtio-balloon-pci,id=balloon0

2.Start listenning port on localhost:
/usr/libexec/qemu-kvm -cpu SandyBridge -name 122BLKWIN2016 -enable-kvm -m 8G -smp 4 -nodefconfig -nodefaults -rtc base=localtime,driftfix=slew -boot order=cd,menu=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=win2016.raw,if=none,id=drive-ide0-0-0,format=raw,serial=mike_cao,cache=none -device ide-drive,drive=drive-ide0-0-0,id=ide0-0-0 -drive file=en_windows_server_2016_x64_dvd_9327751.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,drive=drive-ide0-1-0,id=ide0-1-0,bus=ide.0,unit=1 -netdev tap,script=/etc/qemu-ifup,downscript=no,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=00:52:4c:00:8d:a7 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=isa_serial0 -device usb-tablet,id=input0 -vnc 0.0.0.0:1 -vga cirrus -cdrom /usr/share/virtio-win/virtio-win.iso -monitor stdio -qmp tcp:0:4445,server,nowait -incoming tcp::5888

3.Do migration:
 {"execute": "migrate","arguments":{"uri": "tcp:0:5888"}}

4.query qtree in HMP
(qemu) info qtree 


Actual results:
after step4,qemu core dump

Expected results:
guest works well,no crash,no core dump

Additional info:
1."-vga std" & "-vga qxl" do NOT hit this issue;
2.rhel6.8 released qemu(qemu-kvm-rhev-0.12.1.2-2.491.el6_8.2.x86_64) also hit this issue;
3.(gdb) bt
#0  0x00007f5a0f23beeb in qdev_print (mon=0x7f5a10ad7410, bus=<value optimized out>, indent=6)
    at /usr/src/debug/qemu-kvm-0.12.1.2/hw/qdev.c:846
#1  qbus_print (mon=0x7f5a10ad7410, bus=<value optimized out>, indent=6) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/qdev.c:862
#2  0x00007f5a0f23bf2e in qdev_print (mon=0x7f5a10ad7410, bus=<value optimized out>, indent=2)
    at /usr/src/debug/qemu-kvm-0.12.1.2/hw/qdev.c:850
#3  qbus_print (mon=0x7f5a10ad7410, bus=<value optimized out>, indent=2) at /usr/src/debug/qemu-kvm-0.12.1.2/hw/qdev.c:862
#4  0x00007f5a0f1a89d3 in do_info (mon=0x7f5a10ad7410, qdict=<value optimized out>, ret_data=0x7ffebf05b4c8)
    at /usr/src/debug/qemu-kvm-0.12.1.2/monitor.c:901
#5  0x00007f5a0f1a65b0 in monitor_call_handler (mon=0x7f5a10ad7410, cmd=0x7f5a0f6b4410, params=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.12.1.2/monitor.c:4377
#6  0x00007f5a0f1aba3f in handle_user_command (mon=0x7f5a10ad7410, cmdline=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.12.1.2/monitor.c:4414
#7  0x00007f5a0f1abb77 in monitor_command_cb (mon=0x7f5a10ad7410, cmdline=<value optimized out>, opaque=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.12.1.2/monitor.c:5052
#8  0x00007f5a0f21c15d in readline_handle_byte (rs=0x7f5a132bd5d0, ch=<value optimized out>)
    at /usr/src/debug/qemu-kvm-0.12.1.2/readline.c:369
#9  0x00007f5a0f1abda5 in monitor_read (opaque=<value optimized out>, buf=0x7ffebf05b5c0 "\rl\323\vZ\177", size=1)
    at /usr/src/debug/qemu-kvm-0.12.1.2/monitor.c:5038
#10 0x00007f5a0f23328f in qemu_chr_be_write (chan=<value optimized out>, cond=<value optimized out>, opaque=0x7f5a10a1d590)
    at /usr/src/debug/qemu-kvm-0.12.1.2/qemu-char.c:192
#11 fd_chr_read (chan=<value optimized out>, cond=<value optimized out>, opaque=0x7f5a10a1d590)
    at /usr/src/debug/qemu-kvm-0.12.1.2/qemu-char.c:797
#12 0x00007f5a0e5ef642 in ?? ()
#13 0x00007f5a0f6e6d00 in ?? ()
#14 0x00007f5a0e5effd2 in ?? ()
#15 0x00007f5a0e6348c0 in ?? ()
#16 0x00007f5a10ad7990 in ?? ()
#17 0x00007ffebf05c630 in ?? ()
#18 0x00007f5a10a1e5e8 in ?? ()
#19 0x00007ffebf05c648 in ?? ()
#20 0x00007ffebf05c640 in ?? ()
#21 0x00007f5a10ad7cb0 in ?? ()
#22 0x0000000000000000 in ?? ()

Comment 3 Amnon Ilan 2016-11-17 18:04:38 UTC
Maybe related to:
https://bugzilla.redhat.com/show_bug.cgi?id=1377575

Comment 4 Ladi Prosek 2016-11-22 13:27:17 UTC
Hi Li Jin,

Would it be possible to get access to the affected host? Thanks!

Comment 7 Ladi Prosek 2016-11-23 13:28:02 UTC
This is caused by

static int cirrus_post_load(void *opaque, int version_id)

being called twice on the destination. The second call passes a pointer to PCICirrusVGAState but cirrus_post_load treats it as a pointer to CirrusVGAState which leads to corrupting a pointer value in the object hierarchy. The fix, tracked in bug 1294941, is to remove the second call by leaving vmstate_pci_cirrus_vga.post_load unassigned.

Comment 8 Zhengtong 2016-12-06 03:21:06 UTC
Hi, Yash 

May I know when will the new fixed qemu-kvm build version comes out, so we can arrange the testing work on qe side ?

Comment 9 Yash Mankad 2016-12-10 13:41:25 UTC
Hi Zhengtong,

As Ladi pointed out in comment 7, the fix for this was tracked in bug 1294941, for which I ran the build last week, and is available in qemu-kvm-0.12.1.2-2.497.el6

Comment 10 Qunfang Zhang 2016-12-12 05:18:45 UTC
(In reply to Yash Mankad from comment #9)
> Hi Zhengtong,
> 
> As Ladi pointed out in comment 7, the fix for this was tracked in bug
> 1294941, for which I ran the build last week, and is available in
> qemu-kvm-0.12.1.2-2.497.el6

Hi, Yash

If so, could we also mark this bug as MODIFIED? Or there's some other patches need to merge?  Thanks.

Comment 11 Yash Mankad 2016-12-12 12:43:11 UTC
Hi Ladi,

I don't see any other patches on queue for PCICirrusVGAState, but could you confirm Qunfang's question in comment 10 that the fix in bug 1294941 also fixes this bug and there are no more patches to merge ?

Thanks,
Yash

Comment 12 Ladi Prosek 2016-12-12 12:51:21 UTC
Hi Yash,

(In reply to Yash Mankad from comment #11)
> Hi Ladi,
> 
> I don't see any other patches on queue for PCICirrusVGAState, but could you
> confirm Qunfang's question in comment 10 that the fix in bug 1294941 also
> fixes this bug and there are no more patches to merge ?

Correct, the fix for bug 1294941 fixes this bug also. Thanks!

Comment 13 Yash Mankad 2016-12-12 12:57:44 UTC
Thanks Ladi

(In reply to Qunfang Zhang from comment #10)
> (In reply to Yash Mankad from comment #9)
> > Hi Zhengtong,
> > 
> > As Ladi pointed out in comment 7, the fix for this was tracked in bug
> > 1294941, for which I ran the build last week, and is available in
> > qemu-kvm-0.12.1.2-2.497.el6
> 
> Hi, Yash
> 
> If so, could we also mark this bug as MODIFIED? Or there's some other
> patches need to merge?  Thanks.

Qunfang, based on Ladi's confirmation in comment 12, marking this bug as MODIFIED

Comment 14 Qunfang Zhang 2016-12-13 05:39:32 UTC
Got it, thanks Yash and Ladi.

Comment 15 Yash Mankad 2016-12-15 15:32:06 UTC
Fix included in qemu-kvm-0.12.1.2-2.497.el6

Comment 16 xianwang 2016-12-16 12:06:09 UTC
Bug reproduced:
Host:
distro:RHEL-6.9-20161201.0 Server x86_64
kernel:2.6.32-667.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.495.el6.x86_64
seabios-0.6.1.2-30.el6.x86_64

Steps to Reproduce:
1.boot win2016 guest with -vga cirrus:
/usr/libexec/qemu-kvm \
  -name bug1392287 \
  -m 2G \
  -cpu host \
  -smp 2 \
  -nodefconfig \
  -nodefaults \
  -rtc base=localtime,driftfix=slew \
  -boot order=cd,menu=on \
  -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
  -drive file=/root/win2016-64-virtio-scsi.raw,if=none,id=drive-ide0-0-0,format=raw,cache=none \
  -device ide-drive,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
  -netdev tap,script=/etc/qemu-ifup,downscript=no,id=hostnet0 \
  -device e1000,netdev=hostnet0,id=net0,mac=00:52:4c:00:8d:a7 \
  -chardev pty,id=charserial0 \
  -device isa-serial,chardev=charserial0,id=isa_serial0 \
  -device usb-tablet,id=input0 \
  -vnc 0.0.0.0:1 \
  -vga cirrus \
  -monitor stdio \
  -qmp tcp:0:8881,server,nowait \
  -device virtio-balloon-pci,id=balloon0

2.Start listenning port on localhost:
qemu command is same as above with appending "-incoming tcp:0:5811"

3.Do migration:
(qemu) migrate -d tcp:127.0.0.1:5811

4.query qtree in HMP(dst)
(qemu) info qtree 

Actual results:
qemu core dump, prompt following info:
sd1.sh: line 23: 11111 Segmentation fault (core dumped) 

Bug is verified with following version:
kernel:2.6.32-676.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.497.el6.x86_64
seabios-0.6.1.2-30.el6.x86_64

Steps is same with reproduction.

Result:
migration is completed, vm works well,no crash,no core dump.

So, this bug is fixed.

Comment 17 Yash Mankad 2016-12-17 15:24:34 UTC
Moving the bug to ON_QA.
Based on comment 16, if the bug has been verified,
Xianwang, could you kindly change the state to VERIFIED.

Comment 18 xianwang 2016-12-19 02:57:39 UTC
(In reply to Yash Mankad from comment #17)
> Moving the bug to ON_QA.
> Based on comment 16, if the bug has been verified,
> Xianwang, could you kindly change the state to VERIFIED.


Referring to comment16, this bug is fixed, so change the status to verified.

Comment 20 errata-xmlrpc 2017-03-21 09:40:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2017-0621.html


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