qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Subject: [Qemu-devel] [RESEND v2 0/3] Fix some memory leaks about query memdev
Date: Mon, 18 Aug 2014 14:46:32 +0800	[thread overview]
Message-ID: <cover.1408344055.git.chen.fan.fnst@cn.fujitsu.com> (raw)

when using valgrind to test the command "query memdev", I had
found some memory leaks. the test result:

==13802== 4 bytes in 1 blocks are definitely lost in loss record 125 of 8,508
==13802==    at 0x4A08934: malloc (vg_replace_malloc.c:291)
==13802==    by 0x4A08AA8: realloc (vg_replace_malloc.c:687)
==13802==    by 0x64C5736: g_realloc (in /usr/lib64/libglib-2.0.so.0.3400.2)
==13802==    by 0x64DE226: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
==13802==    by 0x64DE279: g_string_sized_new (in /usr/lib64/libglib-2.0.so.0.3400.2)
==13802==    by 0x47CFBB: string_output_visitor_new (string-output-visitor.c:341)
==13802==    by 0x3F456F: object_property_get_uint16List (object.c:970)
==13802==    by 0x1E8764: query_memdev (numa.c:361)
==13802==    by 0x3F3248: object_child_foreach (object.c:686)
==13802==    by 0x1E9141: qmp_query_memdev (numa.c:389)
==13802==    by 0x2D79A0: qmp_marshal_input_query_memdev (qmp-marshal.c:5057)
==13802==    by 0x1DD7D7: handle_qmp_command (monitor.c:5038)

==15046== 48 (16 direct, 32 indirect) bytes in 1 blocks are definitely lost in loss record 4,722 of 8,549
==15046==    at 0x4A08934: malloc (vg_replace_malloc.c:291)
==15046==    by 0x64C541D: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
==15046==    by 0x64C56E6: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.3400.2)
==15046==    by 0x1E868C: query_memdev (numa.c:325)
==15046==    by 0x3F3258: object_child_foreach (object.c:686)
==15046==    by 0x1E9141: qmp_query_memdev (numa.c:389)
==15046==    by 0x2DDFF3: hmp_info_memdev (hmp.c:1687)
==15046==    by 0x1E4B08: handle_user_command (monitor.c:4119)
==15046==    by 0x1E4E7A: monitor_command_cb (monitor.c:5156)
==15046==    by 0x496056: readline_handle_byte (readline.c:391)
==15046==    by 0x1E4BCE: monitor_read (monitor.c:5139)
==15046==    by 0x2BCDEF: fd_chr_read (qemu-char.c:213)


Chen Fan (3):
  query-memdev: fix potential memory leaks
  qom/object.c: fix string_output_get_string() memory leak
  hmp: fix MemdevList memory leak

 hmp.c        |  8 ++++++--
 numa.c       | 15 +++++++--------
 qom/object.c | 12 ++++++++++--
 3 files changed, 23 insertions(+), 12 deletions(-)

-- 
1.9.3

             reply	other threads:[~2014-08-18  6:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-18  6:46 Chen Fan [this message]
2014-08-18  6:46 ` [Qemu-devel] [RESEND v2 1/3] query-memdev: fix potential memory leaks Chen Fan
2014-08-18  6:46 ` [Qemu-devel] [RESEND v2 2/3] qom/object.c: fix string_output_get_string() memory leak Chen Fan
2014-08-18  6:46 ` [Qemu-devel] [RESEND v2 3/3] hmp: fix MemdevList " Chen Fan
2014-08-25  3:37 ` [Qemu-devel] [RESEND v2 0/3] Fix some memory leaks about query memdev chen.fan.fnst
2014-08-28  1:17 ` chen.fan.fnst
2014-08-29 16:29 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2014-09-01  1:41   ` chen.fan.fnst

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=cover.1408344055.git.chen.fan.fnst@cn.fujitsu.com \
    --to=chen.fan.fnst@cn.fujitsu.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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).