Bug 1876907
Summary: | Unwanted GLib error message is shown when virsh qemu-monitor-event command times out | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Ján Tomko <jtomko> |
Component: | libvirt | Assignee: | Ján Tomko <jtomko> |
Status: | CLOSED ERRATA | QA Contact: | Lili Zhu <lizhu> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 8.2 | CC: | chorn, fjin, fj-lsoft-bm, fj-lsoft-ofuku, jdenemar, jtomko, lcapitulino, lmen, tumeya, virt-maint, yafu, yalzhang, yoguma |
Target Milestone: | rc | ||
Target Release: | 8.3 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | QJ200701-008/83Z | ||
Fixed In Version: | libvirt-6.6.0-5.el8 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | 1861176 | Environment: | |
Last Closed: | 2020-11-17 17:51:44 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: | |||
Bug Depends On: | |||
Bug Blocks: | 1861176 |
Description
Ján Tomko
2020-09-08 13:28:57 UTC
Patch posted upstream: https://www.redhat.com/archives/libvir-list/2020-September/msg00425.html Fixed upstream by: commit 92b252456ee6d6ffc6e39e62ce1ce6c50113e00e Author: Ján Tomko <jtomko> CommitDate: 2020-09-08 16:07:47 +0200 check for NULL before calling g_regex_unref g_regex_unref reports an error if called with a NULL argument. We have two cases in the code where we (possibly) call it on a NULL argument. The interesting one is in virDomainQemuMonitorEventCleanup. Based on VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX, we unref data->regex, which has two problems: * On the client side, flags is -1 so the comparison is true even if no regex was used, reproducible by: $ virsh qemu-monitor-event --timeout 1 which results in an ugly error: (process:1289846): GLib-CRITICAL **: 14:58:42.631: g_regex_unref: assertion 'regex != NULL' failed * On the server side, we only create the regex if both the flag and the string are present, so it's possible to trigger this message by: $ virsh qemu-monitor-event --regex --timeout 1 Use a non-NULL comparison instead of the flag to decide whether we need to unref the regex. And add a non-NULL check to the unref in the VirtualBox test too. Signed-off-by: Ján Tomko <jtomko> Fixes: 71efb59a4de7c51b1bc889a316f1796ebf55738f https://bugzilla.redhat.com/show_bug.cgi?id=1876907 Reviewed-by: Peter Krempa <pkrempa> Reviewed-by: Martin Kletzander <mkletzan> git describe: v6.7.0-90-g92b252456e Reproduce this bug with: libvirt-6.6.0-4.virtcov.el8.x86_64 # virsh qemu-monitor-event --timeout 1 event loop timed out events received: 0 (process:1732615): GLib-CRITICAL **: 21:21:10.896: g_regex_unref: assertion 'regex != NULL' failed Verify this bug with: libvirt-6.6.0-6.virtcov.el8.x86_64 # virsh qemu-monitor-event --timeout 1 event loop timed out events received: 0 # virsh qemu-monitor-event ^Cevent loop interrupted events received: 0 Glib error message was not shown, mark the bug as verified 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 (virt:8.3 bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2020:5137 |