qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [PULL 0/6] Vga 20190628 patches


From: Peter Maydell
Subject: Re: [Qemu-arm] [PULL 0/6] Vga 20190628 patches
Date: Tue, 2 Jul 2019 18:08:52 +0100

On Tue, 2 Jul 2019 at 17:48, Gerd Hoffmann <address@hidden> wrote:
>
> On Tue, Jul 02, 2019 at 02:47:12PM +0100, Peter Maydell wrote:
> > On Tue, 2 Jul 2019 at 10:17, Peter Maydell <address@hidden> wrote:
> > Hmm, the bitbang-i2c changes in this pull seem to have broken
> > patchew's asan build:
> > https://patchew.org/logs/address@hidden/testing.asan/?type=message
> >
> > (probably because now we're using and testing the buggy
> > code in a way we weren't before)
>
> Hmm.  Yes, gpio_i2c_init() allocates memory (in inlined
> bitbang_i2c_init).  There is no exit() function so the
> memory is never freed indeed.  On the other hand i2c
> devices are not really hotpluggable, so maybe we only
> need to tag it that way?

The problem is that the qmp 'introspect this device' commands
do an init-(but not realize)-then-delete cycle, which will leak
memory. This isn't a big thing for real-life use (people don't
repeatedly introspect the same device that they can't usefully
use dynamically anyway), but it does get exercised by 'make check',
which is why the sanitizer complains.

I've just sent a patch which tries to fix this by switching
to making it initialize an inlined struct rather than allocating
memory for it.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]