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 990566 - QMP: possible memory leaks on commands failure
Summary: QMP: possible memory leaks on commands failure
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Luiz Capitulino
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 990316
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-31 13:15 UTC by Luiz Capitulino
Modified: 2014-06-18 03:32 UTC (History)
8 users (show)

Fixed In Version: qemu-kvm-1.5.3-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 990316
Environment:
Last Closed: 2014-06-13 13:20:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Luiz Capitulino 2013-07-31 13:15:29 UTC
+++ This bug was initially created as a clone of Bug #990316 +++

Description of problem:

A number of QMP commands will possibly leak memory on failure because the release of QAPI structures is skipped on failure.

Version-Release number of selected component (if applicable): qemu-kvm-0.12.1.2-2.382.el6 (and previous)


How reproducible:

As the leak is usually small, it's hard to see. Maybe you could write a script to send the following command:

{ "execute": "dump-guest-memory", "arguments": { "protocol": "/a/a", "paging": false } }

To QMP in a loop for dozens of minutes and watch for an RSS increase, but more important than trying to reproduce this issue is to make sure that we're not breaking existing commands.

Comment 1 Luiz Capitulino 2013-09-30 20:20:21 UTC
The rebase to QEMU 1.5.3 brought the fix for this issue in (commit aa83f2e42), moving to ON_QA.

Comment 2 mazhang 2014-01-06 07:58:02 UTC
Hi Luiz,

This bug was a clone of bz990316 on rhel6, But I can't reproduce it on rhel7 as the steps bz990316 provided. Not found RSS increase with issuing following command 100 times. 
    { "execute": "dump-guest-memory", "arguments": { "protocol": "/a/a", "paging": false } }

Is there any other way to reproduce and verify this bug?

Thanks,
Mazhang.

Comment 3 Luiz Capitulino 2014-01-06 14:20:11 UTC
This one is a bit hard to reliably reproduce in practice. What I suggest you to do is to test the following commands:

o __com.redhat_block-commit
o transaction
o blockdev-snapshot-sync
o __com.redhat_drive-reopen
o __com.redhat_drive-mirror
o dump-guest-memory
o chardev-add/remove

Test regular usage (success and some errors conditions as well). If they work as expected, then you can consider this bz verified.

Comment 5 juzhang 2014-01-10 09:43:14 UTC
(In reply to Luiz Capitulino from comment #3)
> This one is a bit hard to reliably reproduce in practice. What I suggest you
> to do is to test the following commands:
> 
> o __com.redhat_block-commit
> o transaction
> o blockdev-snapshot-sync
> o __com.redhat_drive-reopen
> o __com.redhat_drive-mirror
> o dump-guest-memory
> o chardev-add/remove
> 
> Test regular usage (success and some errors conditions as well). If they
> work as expected, then you can consider this bz verified.

Hi Mazhang,

Could you have a try and update the result in the bz?

Best Regards,
Junyi

Comment 6 mazhang 2014-01-24 09:42:14 UTC
(In reply to juzhang from comment #5)
> (In reply to Luiz Capitulino from comment #3)
> > This one is a bit hard to reliably reproduce in practice. What I suggest you
> > to do is to test the following commands:
> > 
> > o __com.redhat_block-commit
> > o transaction
> > o blockdev-snapshot-sync
> > o __com.redhat_drive-reopen
> > o __com.redhat_drive-mirror
> > o dump-guest-memory
> > o chardev-add/remove
> > 
> > Test regular usage (success and some errors conditions as well). If they
> > work as expected, then you can consider this bz verified.
> 
> Hi Mazhang,
> 
> Could you have a try and update the result in the bz?
> 
> Best Regards,
> Junyi

Update latest qemu-kvm and test this bug.

Host:
qemu-kvm-rhev-1.5.3-39.el7.x86_64
kernel-3.10.0-78.el7.x86_64

Guest:
kernel-3.10.0-64.el7.x86_64

Result:
{"execute":"dump-guest-memory","arguments":{"paging": false,"protocol":"file:/tmp/guest-memory"}}
{"timestamp": {"seconds": 1390553164, "microseconds": 550373}, "event": "STOP"}
{"timestamp": {"seconds": 1390553174, "microseconds": 952832}, "event": "RESUME"}
{"return": {}}
{"execute":"dump-guest-memory","arguments":{"paging": False,"protocol":"file:/tmp/guest-memory1"}}
{"error": {"class": "GenericError", "desc": "Invalid JSON syntax"}}
{"error": {"class": "GenericError", "desc": "Invalid JSON syntax"}}
{"error": {"class": "GenericError", "desc": "Expected 'object' in QMP input"}}
{"error": {"class": "GenericError", "desc": "Invalid JSON syntax"}}
{"error": {"class": "GenericError", "desc": "Expected 'object' in QMP input"}}
{"execute":"chardev-add","arguments":{"id":"channel0","backend":{"type":"socket","data":{"addr": {"type":"unix", "data": {"path": "/tmp/mm"}}}}}}
{"return": {}}
{"execute":"chardev-remove","arguments":{"id":"channel0"}}
{"return": {}}
{"execute":"chardev-add","arguments":{"id":"channel0","backend":{"type":"socketsocket","data":{"addr": {"type":"unix", "data": {"path": "/tmp/mm"}}}}}}
{"error": {"class": "GenericError", "desc": "Invalid parameter 'socketsocket'"}}
{ "execute": "drive-mirror", "arguments": { "device": "drive-virtio-disk0", "target": "/root/sn1", "format": "qcow2", "mode": "absolute-paths", "sync": "full", "speed": 1000000000, "on-source-error": "stop", "on-target-error": "stop" } }
{"return": {}}
{"return": {}}
{ 'execute': 'transaction', 'arguments':
  {'actions': [
    { 'type': 'blockdev-snapshot-sync', 'data' :
      { 'device': 'drive-virtio-disk0', 'snapshot-file': '/home/sn-1-1.qcow2', 'format': 'qcow2' } },
    { 'type': 'blockdev-snapshot-sync', 'data' :
      { 'device': 'drive-virtio-disk1', 'snapshot-file': '/home/sn-2-1.qcow2', 'format': 'qcow2' } } ] } }

{ 'execute': 'transaction', 'arguments':
  {'actions': [
    { 'type': 'blockdev-snapshot-sync', 'data' :
      { 'device': 'drive-virtio-disk0', 'snapshot-file': '/home/sn-1-2.qcow2', 'format': 'qcow2' } },
    { 'type': 'blockdev-snapshot-sync', 'data' :
      { 'device': 'drive-virtio-disk1', 'snapshot-file': '/home/sn-2-2.qcow2', 'format': 'qcow2' } } ] } }
{"return": {}}
{"return": {}}
{ "execute": "blockdev-snapshot-sync", "arguments": { "device": "drive-virtio-disk0", "snapshot-file": "/root/sn4", "format": "qcow2" } }
{"return": {}}
{ "execute": "block-commit", "arguments": { "device": "drive-virtio-disk0", "base": "/root/sn1", "top": "/root/sn3", "speed": 1000000000 } }
{"return": {}}

All above command works expected, this bug has been fixed.

Comment 8 Ludek Smid 2014-06-13 13:20:15 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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