[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] vnc: fix memory leak when vnc disconnect
From: |
Li Qiang |
Subject: |
Re: [Qemu-devel] [PATCH] vnc: fix memory leak when vnc disconnect |
Date: |
Tue, 17 Sep 2019 21:42:57 +0800 |
Gerd Hoffmann <address@hidden> 于2019年9月17日周二 下午7:45写道:
> On Sat, Aug 31, 2019 at 08:39:22AM -0700, Li Qiang wrote:
> > Currently when qemu receives a vnc connect, it creates a 'VncState' to
> > represent this connection. In 'vnc_worker_thread_loop' it creates a
> > local 'VncState'. The connection 'VcnState' and local 'VncState' exchange
> > data in 'vnc_async_encoding_start' and 'vnc_async_encoding_end'.
> > In 'zrle_compress_data' it calls 'deflateInit2' to allocate the libz
> library
> > opaque data. The 'VncState' used in 'zrle_compress_data' is the local
> > 'VncState'. In 'vnc_zrle_clear' it calls 'deflateEnd' to free the libz
> > library opaque data. The 'VncState' used in 'vnc_zrle_clear' is the
> connection
> > 'VncState'. In currently implementation there will be a memory leak when
> the
> > vnc disconnect. Following is the asan output backtrack:
>
> Added to ui patch queue.
>
>
Shouldn't we care the race condition between main thread and the vnc thread?
Thanks,
Li Qiang
> thanks,
> Gerd
>
>