Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1144920 - libvirtd crashed after use qemu-monitor-event --regex to a running guest
libvirtd crashed after use qemu-monitor-event --regex to a running guest
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.1
x86_64 Linux
high Severity high
: rc
: ---
Assigned To: Ján Tomko
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-21 22:25 EDT by Luyao Huang
Modified: 2015-03-05 02:44 EST (History)
6 users (show)

See Also:
Fixed In Version: libvirt-1.2.8-4.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 02:44:55 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
back trace (9.89 KB, text/plain)
2014-09-21 22:25 EDT, Luyao Huang
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 07:10:54 EST

  None (edit)
Description Luyao Huang 2014-09-21 22:25:43 EDT
Created attachment 939852 [details]
back trace

description of problem:
libvirtd crashed after use qemu-monitor-event --regex to a running guest

Version-Release number of selected component (if applicable):
libvirt-1.2.8-3.el7.x86_64
qemu-kvm-rhev-2.1.0-3.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.prepare a running guest

1.# ps aux|grep libvirtd
root     20077  2.2  0.2 563028 19132 ?        Ssl  18:35   0:00 /usr/sbin/libvirtd
root     20234  0.0  0.0 112640   968 pts/10   S+   18:36   0:00 grep --color=auto libvirtd

2.# virsh qemu-monitor-event r6 --regex
error: End of file while reading data: Input/output error
error: Failed to reconnect to the hypervisor

3.# ps aux|grep libvirtd
root     20239 22.0  0.2 563028 19508 ?        Ssl  18:36   0:00 /usr/sbin/libvirtd
root     20332  0.0  0.0 112640   972 pts/10   R+   18:36   0:00 grep --color=auto libvirtd




Actual results:
libvirtd crashed after use qemu-monitor-event --regex to a running guest

Expected results:
Don't crash
Additional info:
Comment 1 Ján Tomko 2014-09-22 08:10:32 EDT
Upstream patch:
https://www.redhat.com/archives/libvir-list/2014-September/msg01276.html
Comment 2 Eric Blake 2014-09-22 11:57:50 EDT
Which is smarter, ignoring the flags when 'event' is NULL, or requiring that 'event' be non-NULL when either the regex or nocase is present?
Comment 3 Ján Tomko 2014-09-22 12:26:43 EDT
I think ingoring it would be nicer than throwing an error.

I'm fine with your fix as well, but the error message could be more specific (as NULL argument is allowed without the flags).
Comment 4 Ján Tomko 2014-09-26 07:45:29 EDT
Fixed upstream by:
commit b987c4c3f4829eb8a0134b687cb9748ff724f98a
Author:     Ján Tomko <jtomko@redhat.com>
CommitDate: 2014-09-26 13:35:51 +0200

    Check for NULL in qemu monitor event filter
    
    When virConnectDomainQemuMonitorEventRegister is called with the
    VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX flag,
    ignore the flag instead of crashing.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1144920

git describe: v1.2.9-rc1-16-gb987c4c
Comment 7 vivian zhang 2014-10-08 01:44:23 EDT
I can reproduce with build: libvirt-1.2.8-3.el7.x86_64

verify with build : libvirt-1.2.8-4.el7.x86_64

step:
1: prepare a running guest r6

2: # ps aux |grep libvirtd
root      4177  0.6  0.2 1079420 23192 ?       Ssl  13:15   0:06 /usr/sbin/libvirtd --listen
root      5826  0.0  0.0 112644   984 pts/0    S+   13:33   0:00 grep --color=auto libvirtd


3: run command qemu-monitor-event with --regex, then ctrl+c to quit normally 
# virsh qemu-monitor-event r6 --regex
^Cevent loop interrupted
events received: 0

4. run command qemu-monitor-event with --regex, then destroy guest to trigger events
# virsh qemu-monitor-event r6 --regex
event SHUTDOWN at 1412746683.984157 for domain r6: <null>
events received: 1

5. recheck libvirtd process, no crash happened
# ps aux |grep libvirtd
root      4177  0.6  0.2 1079420 23356 ?       Ssl  13:15   0:09 /usr/sbin/libvirtd --listen
root      6685  0.0  0.0 112644   984 pts/0    S+   13:39   0:00 grep --color=auto libvirtd


move to verified.
Comment 9 errata-xmlrpc 2015-03-05 02:44:55 EST
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-2015-0323.html

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