From: Max Reitz <mreitz@redhat.com>
To: pannengyuan@huawei.com, berto@igalia.com, kwolf@redhat.com
Cc: liyiting@huawei.com, kuhn.chenqun@huawei.com,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
zhang.zhanghailiang@huawei.com
Subject: Re: [PATCH V2] throttle-groups: fix memory leak in throttle_group_set_limit:
Date: Wed, 27 Nov 2019 13:28:07 +0100 [thread overview]
Message-ID: <079361c7-8474-ca67-7e7c-8fd49cd913b6@redhat.com> (raw)
In-Reply-To: <1574835614-42028-1-git-send-email-pannengyuan@huawei.com>
[-- Attachment #1.1: Type: text/plain, Size: 1805 bytes --]
On 27.11.19 07:20, pannengyuan@huawei.com wrote:
> From: PanNengyuan <pannengyuan@huawei.com>
>
> This avoid a memory leak when qom-set is called to set throttle_group
> limits, here is an easy way to reproduce:
>
> 1. run qemu-iotests as follow and check the result with asan:
> ./check -qcow2 184
>
> Following is the asan output backtrack:
> Direct leak of 912 byte(s) in 3 object(s) allocated from:
> #0 0xffff8d7ab3c3 in __interceptor_calloc (/lib64/libasan.so.4+0xd33c3)
> #1 0xffff8d4c31cb in g_malloc0 (/lib64/libglib-2.0.so.0+0x571cb)
> #2 0x190c857 in qobject_input_start_struct /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qapi/qobject-input-visitor.c:295
> #3 0x19070df in visit_start_struct /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qapi/qapi-visit-core.c:49
> #4 0x1948b87 in visit_type_ThrottleLimits qapi/qapi-visit-block-core.c:3759
> #5 0x17e4aa3 in throttle_group_set_limits /mnt/sdc/qemu-master/qemu-4.2.0-rc0/block/throttle-groups.c:900
> #6 0x1650eff in object_property_set /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qom/object.c:1272
> #7 0x1658517 in object_property_set_qobject /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qom/qom-qobject.c:26
> #8 0x15880bb in qmp_qom_set /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qom/qom-qmp-cmds.c:74
> #9 0x157e3e3 in qmp_marshal_qom_set qapi/qapi-commands-qom.c:154
>
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: PanNengyuan <pannengyuan@huawei.com>
> ---
> Changes v2 to v1:
> - remove unused var 'arg' (suggested by Alberto Garcia)
> ---
> block/throttle-groups.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks, applied to my block-next branch for 5.0:
https://git.xanclic.moe/XanClic/qemu/commits/branch/block-next
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2019-11-27 12:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-27 6:20 [PATCH V2] throttle-groups: fix memory leak in throttle_group_set_limit: pannengyuan
2019-11-27 12:28 ` Max Reitz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=079361c7-8474-ca67-7e7c-8fd49cd913b6@redhat.com \
--to=mreitz@redhat.com \
--cc=berto@igalia.com \
--cc=kuhn.chenqun@huawei.com \
--cc=kwolf@redhat.com \
--cc=liyiting@huawei.com \
--cc=pannengyuan@huawei.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=zhang.zhanghailiang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).