From: Avi Kivity <avi@redhat.com>
To: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Cc: Leszek Urbanski <tygrys@moo.pl>, Ryan Harper <ryanh@us.ibm.com>,
kvm@vger.kernel.org, Stefan Hajnoczi <stefanha@gmail.com>
Subject: Re: [PATCH] block: Free iovec arrays allocated by multiwrite_merge()
Date: Sun, 25 Apr 2010 16:35:29 +0300 [thread overview]
Message-ID: <4BD44521.6040706@redhat.com> (raw)
In-Reply-To: <1272202054-4831-1-git-send-email-stefanha@linux.vnet.ibm.com>
On 04/25/2010 04:27 PM, Stefan Hajnoczi wrote:
> From: Stefan Hajnoczi<stefanha@gmail.com>
>
> The MALLOC_TRACE output didn't look useful when I tried it either.
>
> Instead I used the following to find origin of the leak. Still very basic but
> works better with qemu_malloc() and friends.
>
> This is just a hack but I wanted to share it in case someone finds it useful in
> the future.
>
> new file mode 100644
> index 0000000..a5fa51a
> --- /dev/null
> +++ b/leakcheck.c
> @@ -0,0 +1,17 @@
> +#include<stdio.h>
> +
> +static FILE *fp;
> +
> +extern void leakcheck_log(char action, void *old_addr, void *addr, size_t size, void *ret1);
> +
> +void leakcheck_log(char action, void *old_addr, void *addr, size_t size, void *ret1)
> +{
> + if (!fp) {
> + fp = fopen("/tmp/leakcheck.log", "w");
> + if (!fp) {
> + return;
> + }
> + }
>
use backtrace(3) or backtrace_symbols(3), or even better, an external tool?
--
error compiling committee.c: too many arguments to function
prev parent reply other threads:[~2010-04-25 13:35 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-20 22:29 Huge memory leak in virtio, see kvm-Bugs-2989366 Leszek Urbanski
2010-04-20 22:51 ` Alexander Graf
2010-04-21 7:53 ` Leszek Urbanski
2010-04-21 8:25 ` Avi Kivity
2010-04-21 1:58 ` Ryan Harper
2010-04-21 6:08 ` Michael Tokarev
2010-04-21 13:29 ` Leszek Urbanski
2010-04-21 18:39 ` Stefan Hajnoczi
2010-04-21 14:32 ` Ryan Harper
2010-04-21 18:27 ` [PATCH] block: Free iovec arrays allocated by multiwrite_merge() Stefan Hajnoczi
2010-04-21 18:35 ` Ryan Harper
2010-04-21 18:43 ` Brian Jackson
2010-04-21 19:59 ` Leszek Urbanski
2010-04-21 20:03 ` Ryan Harper
2010-04-21 20:13 ` Leszek Urbanski
2010-04-25 12:36 ` Avi Kivity
2010-04-25 13:27 ` Stefan Hajnoczi
2010-04-25 13:35 ` Avi Kivity [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=4BD44521.6040706@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=ryanh@us.ibm.com \
--cc=stefanha@gmail.com \
--cc=stefanha@linux.vnet.ibm.com \
--cc=tygrys@moo.pl \
/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