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 1169280 - Segfault while query device properties (ics, icp)
Summary: Segfault while query device properties (ics, icp)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.1
Hardware: ppc64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: David Gibson
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-01 08:55 UTC by Xu Han
Modified: 2015-03-05 09:58 UTC (History)
6 users (show)

Fixed In Version: qemu-kvm-rhev-2.1.2-17.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 09:58:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
qemu-kvm-rhev-2.1.2-15.el7.test.ppc64.rpm (2.06 MB, application/x-rpm)
2014-12-03 01:53 UTC, David Gibson
no flags Details
qemu-kvm-common-rhev-2.1.2-15.el7.test.ppc64.rpm (367.02 KB, application/x-rpm)
2014-12-03 01:53 UTC, David Gibson
no flags Details
qemu-img-rhev-2.1.2-15.el7.test.ppc64.rpm (711.79 KB, application/x-rpm)
2014-12-03 01:55 UTC, David Gibson
no flags Details
qemu-kvm-rhev-debuginfo-2.1.2-15.el7.test.ppc64.rpm (9.38 MB, application/x-rpm)
2014-12-03 01:56 UTC, David Gibson
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0624 0 normal SHIPPED_LIVE Important: qemu-kvm-rhev security, bug fix, and enhancement update 2015-03-05 14:37:36 UTC

Description Xu Han 2014-12-01 08:55:17 UTC
Description of problem:
If a device have no properties, query it will cause segfault:
  # /usr/libexec/qemu-kvm -device ics,?
  Segmentation fault (core dumped)


Backtrace:
#0  error_get_pretty (err=0x0) at util/error.c:153
No locals.
#1  0x0000000053107cd0 in qdev_device_help (opts=0x53993310) at qdev-monitor.c:210
        local_err = 0x0                         <- NULL
        driver = 0x539933a0 "ics"
        prop_list = 0x0
        prop = <optimized out>
...


qdev-monitor.c:
210         error_printf("%s\n", error_get_pretty(local_err));

util/error.c:
150 const char *error_get_pretty(Error *err)
151 {
152     return err->msg;
153 }


The query result of QMP:
{"execute": "device-list-properties", "arguments": {"typename": "ics"}}
{"return": []}


Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.1.2-14.el7.ppc64

How reproducible:
100%

Steps to Reproduce:
1. # /usr/libexec/qemu-kvm -device ics,?

Actual results:
Segfault

Expected results:
No crash

Additional info:

Comment 2 David Gibson 2014-12-03 01:53:20 UTC
Created attachment 963937 [details]
qemu-kvm-rhev-2.1.2-15.el7.test.ppc64.rpm

Comment 3 David Gibson 2014-12-03 01:53:52 UTC
Created attachment 963938 [details]
qemu-kvm-common-rhev-2.1.2-15.el7.test.ppc64.rpm

Comment 4 David Gibson 2014-12-03 01:55:01 UTC
Created attachment 963939 [details]
qemu-img-rhev-2.1.2-15.el7.test.ppc64.rpm

Comment 5 David Gibson 2014-12-03 01:56:56 UTC
Created attachment 963940 [details]
qemu-kvm-rhev-debuginfo-2.1.2-15.el7.test.ppc64.rpm

Comment 6 David Gibson 2014-12-03 02:01:46 UTC
I located a fix for this problem upstream (commit 0722eba9450cb8be9713fec1caa0772330739586).  I've uploaded test packages with this fix backported.  They're not brewed, because somethings up with the dependencies again (on x86).

Please retest with this, then I'll push the fix downstream.

Comment 7 Xu Han 2014-12-05 07:28:40 UTC
Re-tested this issue with above packages.

# set -x; for dev in "icp" "icp-kvm" "ics" "icskvm" "spapr-tce-table"; do ./qemu-kvm -device "$dev",?; echo $?; done; set +x

+ for dev in '"icp"' '"icp-kvm"' '"ics"' '"icskvm"' '"spapr-tce-table"'
+ ./qemu-kvm -device 'icp,?'
+ echo 0
0
+ for dev in '"icp"' '"icp-kvm"' '"ics"' '"icskvm"' '"spapr-tce-table"'
+ ./qemu-kvm -device 'icp-kvm,?'
+ echo 0
0
+ for dev in '"icp"' '"icp-kvm"' '"ics"' '"icskvm"' '"spapr-tce-table"'
+ ./qemu-kvm -device 'ics,?'
+ echo 0
0
+ for dev in '"icp"' '"icp-kvm"' '"ics"' '"icskvm"' '"spapr-tce-table"'
+ ./qemu-kvm -device 'icskvm,?'
+ echo 0
0
+ for dev in '"icp"' '"icp-kvm"' '"ics"' '"icskvm"' '"spapr-tce-table"'
+ ./qemu-kvm -device 'spapr-tce-table,?'
Segmentation fault (core dumped)
+ echo 139
139
+ set +x

The original bug has been fixed. For the last issue, I have filed bug 1170934.

Comment 8 Jeff Nelson 2014-12-17 04:05:10 UTC
Fix included in qemu-kvm-rhev-2.1.2-17.el7

Comment 10 Xu Han 2015-01-05 02:34:44 UTC
Verified this issue with qemu-kvm-rhev-2.1.2-17.el7:

# rpm -q qemu-kvm-rhev
qemu-kvm-rhev-2.1.2-17.el7.ppc64

# set -x; for dev in "icp" "icp-kvm" "ics" "icskvm"; do /usr/libexec/qemu-kvm -device "$dev",?; echo $?; done; set +x
+ for dev in '"icp"' '"icp-kvm"' '"ics"' '"icskvm"'
+ /usr/libexec/qemu-kvm -device 'icp,?'
+ echo 0
0
+ for dev in '"icp"' '"icp-kvm"' '"ics"' '"icskvm"'
+ /usr/libexec/qemu-kvm -device 'icp-kvm,?'
+ echo 0
0
+ for dev in '"icp"' '"icp-kvm"' '"ics"' '"icskvm"'
+ /usr/libexec/qemu-kvm -device 'ics,?'
+ echo 0
0
+ for dev in '"icp"' '"icp-kvm"' '"ics"' '"icskvm"'
+ /usr/libexec/qemu-kvm -device 'icskvm,?'
+ echo 0
0
+ set +x

According to the test result, this bug has been fixed.

Comment 12 errata-xmlrpc 2015-03-05 09:58:47 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-2015-0624.html


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