[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] test-qmp-commands reads freed memory
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] test-qmp-commands reads freed memory |
Date: |
Sat, 8 Mar 2014 16:41:40 +0000 |
On 8 March 2014 16:09, Luiz Capitulino <address@hidden> wrote:
> On Sat, 8 Mar 2014 14:40:27 +0000
> Peter Maydell <address@hidden> wrote:
>
>> The test-qmp-commands test binary seems to read from freed
>> memory. This triggers the MacOSX malloc implementation's
>> assertions. git bisect blames
>
> Can you try the patch below? For the clang ones, I'll have to install it etc,
> so it will take a bit longer.
>
> I wonder how this didn't explode...
>
> diff --git a/tests/test-qmp-commands.c b/tests/test-qmp-commands.c
> index 8e62c2d..554e222 100644
> --- a/tests/test-qmp-commands.c
> +++ b/tests/test-qmp-commands.c
> @@ -141,7 +141,7 @@ static void test_dispatch_cmd_io(void)
>
> ret3 = qobject_to_qint(test_qmp_dispatch(req));
> assert(qint_get_int(ret3) == 66);
> - QDECREF(ret);
> + QDECREF(ret3);
>
> QDECREF(req);
> }
Yep, seems to work (both MacOSX and valgrind are happier).
Tested-by: Peter Maydell <address@hidden>
-- PMM