All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests: fix a memory in test_socket_unix_abstract_good
@ 2020-06-03 16:14 Li Qiang
  2020-06-03 17:25 ` Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Li Qiang @ 2020-06-03 16:14 UTC (permalink / raw)
  To: berrange, marcandre.lureau, zxq_yx_007; +Cc: Li Qiang, qemu-devel

After build qemu with '-fsanitize=address' extra-cflags,
'make check' show following leak:

=================================================================
==44580==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 2500 byte(s) in 1 object(s) allocated from:
    #0 0x7f1b5a8b8d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f1b5a514b10 in g_malloc0 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51b10)
    #2 0xd79ea4e4c0ad31c3  (<unknown module>)

SUMMARY: AddressSanitizer: 2500 byte(s) leaked in 1 allocation(s).

Call 'g_rand_free' in the end of function to avoid this.

Fixes: 4d3a329af59("tests/util-sockets: add abstract unix socket cases")
Signed-off-by: Li Qiang <liq3ea@163.com>
---
 tests/test-util-sockets.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c
index 2ca1e99f17..ca6671f9bf 100644
--- a/tests/test-util-sockets.c
+++ b/tests/test-util-sockets.c
@@ -312,6 +312,7 @@ static void test_socket_unix_abstract_good(void)
     g_thread_join(serv);
 
     g_free(abstract_sock_name);
+    g_rand_free(r);
 }
 #endif
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] tests: fix a memory in test_socket_unix_abstract_good
  2020-06-03 16:14 [PATCH] tests: fix a memory in test_socket_unix_abstract_good Li Qiang
@ 2020-06-03 17:25 ` Philippe Mathieu-Daudé
  2020-06-03 23:10 ` xiaoqiang zhao
  2020-06-18  6:12 ` Li Qiang
  2 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-06-03 17:25 UTC (permalink / raw)
  To: Li Qiang, berrange, marcandre.lureau, zxq_yx_007; +Cc: qemu-devel

On 6/3/20 6:14 PM, Li Qiang wrote:
> After build qemu with '-fsanitize=address' extra-cflags,
> 'make check' show following leak:
> 
> =================================================================
> ==44580==ERROR: LeakSanitizer: detected memory leaks
> 
> Direct leak of 2500 byte(s) in 1 object(s) allocated from:
>     #0 0x7f1b5a8b8d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
>     #1 0x7f1b5a514b10 in g_malloc0 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51b10)
>     #2 0xd79ea4e4c0ad31c3  (<unknown module>)
> 
> SUMMARY: AddressSanitizer: 2500 byte(s) leaked in 1 allocation(s).
> 
> Call 'g_rand_free' in the end of function to avoid this.

GLib doc doesn't seem complete (they don't mention explicitly the
generator returned from g_rand_new has to be released with g_rand_free).

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> 
> Fixes: 4d3a329af59("tests/util-sockets: add abstract unix socket cases")
> Signed-off-by: Li Qiang <liq3ea@163.com>
> ---
>  tests/test-util-sockets.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c
> index 2ca1e99f17..ca6671f9bf 100644
> --- a/tests/test-util-sockets.c
> +++ b/tests/test-util-sockets.c
> @@ -312,6 +312,7 @@ static void test_socket_unix_abstract_good(void)
>      g_thread_join(serv);
>  
>      g_free(abstract_sock_name);
> +    g_rand_free(r);
>  }
>  #endif
>  
> 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] tests: fix a memory in test_socket_unix_abstract_good
  2020-06-03 16:14 [PATCH] tests: fix a memory in test_socket_unix_abstract_good Li Qiang
  2020-06-03 17:25 ` Philippe Mathieu-Daudé
@ 2020-06-03 23:10 ` xiaoqiang zhao
  2020-06-18  6:12 ` Li Qiang
  2 siblings, 0 replies; 7+ messages in thread
From: xiaoqiang zhao @ 2020-06-03 23:10 UTC (permalink / raw)
  To: Li Qiang, berrange, marcandre.lureau; +Cc: qemu-devel

在 2020/6/4 上午12:14, Li Qiang 写道:
> After build qemu with '-fsanitize=address' extra-cflags,
> 'make check' show following leak:
>
> =================================================================
> ==44580==ERROR: LeakSanitizer: detected memory leaks
>
> Direct leak of 2500 byte(s) in 1 object(s) allocated from:
>      #0 0x7f1b5a8b8d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
>      #1 0x7f1b5a514b10 in g_malloc0 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51b10)
>      #2 0xd79ea4e4c0ad31c3  (<unknown module>)
>
> SUMMARY: AddressSanitizer: 2500 byte(s) leaked in 1 allocation(s).
>
> Call 'g_rand_free' in the end of function to avoid this.
>
> Fixes: 4d3a329af59("tests/util-sockets: add abstract unix socket cases")
> Signed-off-by: Li Qiang <liq3ea@163.com>
> ---
>   tests/test-util-sockets.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c
> index 2ca1e99f17..ca6671f9bf 100644
> --- a/tests/test-util-sockets.c
> +++ b/tests/test-util-sockets.c
> @@ -312,6 +312,7 @@ static void test_socket_unix_abstract_good(void)
>       g_thread_join(serv);
>   
>       g_free(abstract_sock_name);
> +    g_rand_free(r);
>   }
>   #endif
>   

Reviewed-by:  xiaoqiang zhao <zxq_yx_007@163.com>



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] tests: fix a memory in test_socket_unix_abstract_good
  2020-06-03 16:14 [PATCH] tests: fix a memory in test_socket_unix_abstract_good Li Qiang
  2020-06-03 17:25 ` Philippe Mathieu-Daudé
  2020-06-03 23:10 ` xiaoqiang zhao
@ 2020-06-18  6:12 ` Li Qiang
  2020-06-24 10:56   ` Daniel P. Berrangé
  2 siblings, 1 reply; 7+ messages in thread
From: Li Qiang @ 2020-06-18  6:12 UTC (permalink / raw)
  To: Li Qiang
  Cc: zxq_yx_007, marcandre lureau, Daniel P. Berrange, Qemu Developers

[-- Attachment #1: Type: text/plain, Size: 1389 bytes --]

Ping..
Anyone queued this?

Thanks,
Li Qiang

Li Qiang <liq3ea@163.com> 于2020年6月4日周四 上午12:31写道:

> After build qemu with '-fsanitize=address' extra-cflags,
> 'make check' show following leak:
>
> =================================================================
> ==44580==ERROR: LeakSanitizer: detected memory leaks
>
> Direct leak of 2500 byte(s) in 1 object(s) allocated from:
>     #0 0x7f1b5a8b8d28 in __interceptor_calloc
> (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
>     #1 0x7f1b5a514b10 in g_malloc0
> (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51b10)
>     #2 0xd79ea4e4c0ad31c3  (<unknown module>)
>
> SUMMARY: AddressSanitizer: 2500 byte(s) leaked in 1 allocation(s).
>
> Call 'g_rand_free' in the end of function to avoid this.
>
> Fixes: 4d3a329af59("tests/util-sockets: add abstract unix socket cases")
> Signed-off-by: Li Qiang <liq3ea@163.com>
> ---
>  tests/test-util-sockets.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c
> index 2ca1e99f17..ca6671f9bf 100644
> --- a/tests/test-util-sockets.c
> +++ b/tests/test-util-sockets.c
> @@ -312,6 +312,7 @@ static void test_socket_unix_abstract_good(void)
>      g_thread_join(serv);
>
>      g_free(abstract_sock_name);
> +    g_rand_free(r);
>  }
>  #endif
>
> --
> 2.17.1
>
>
>

[-- Attachment #2: Type: text/html, Size: 1892 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] tests: fix a memory in test_socket_unix_abstract_good
  2020-06-18  6:12 ` Li Qiang
@ 2020-06-24 10:56   ` Daniel P. Berrangé
  2020-08-13 16:32     ` Li Qiang
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel P. Berrangé @ 2020-06-24 10:56 UTC (permalink / raw)
  To: Li Qiang; +Cc: zxq_yx_007, marcandre lureau, Li Qiang, Qemu Developers

On Thu, Jun 18, 2020 at 02:12:58PM +0800, Li Qiang wrote:
> Ping..
> Anyone queued this?

Thanks, I've queud this now.

> 
> Thanks,
> Li Qiang
> 
> Li Qiang <liq3ea@163.com> 于2020年6月4日周四 上午12:31写道:
> 
> > After build qemu with '-fsanitize=address' extra-cflags,
> > 'make check' show following leak:
> >
> > =================================================================
> > ==44580==ERROR: LeakSanitizer: detected memory leaks
> >
> > Direct leak of 2500 byte(s) in 1 object(s) allocated from:
> >     #0 0x7f1b5a8b8d28 in __interceptor_calloc
> > (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
> >     #1 0x7f1b5a514b10 in g_malloc0
> > (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51b10)
> >     #2 0xd79ea4e4c0ad31c3  (<unknown module>)
> >
> > SUMMARY: AddressSanitizer: 2500 byte(s) leaked in 1 allocation(s).
> >
> > Call 'g_rand_free' in the end of function to avoid this.
> >
> > Fixes: 4d3a329af59("tests/util-sockets: add abstract unix socket cases")
> > Signed-off-by: Li Qiang <liq3ea@163.com>
> > ---
> >  tests/test-util-sockets.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c
> > index 2ca1e99f17..ca6671f9bf 100644
> > --- a/tests/test-util-sockets.c
> > +++ b/tests/test-util-sockets.c
> > @@ -312,6 +312,7 @@ static void test_socket_unix_abstract_good(void)
> >      g_thread_join(serv);
> >
> >      g_free(abstract_sock_name);
> > +    g_rand_free(r);
> >  }
> >  #endif
> >
> > --
> > 2.17.1
> >
> >
> >

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] tests: fix a memory in test_socket_unix_abstract_good
  2020-06-24 10:56   ` Daniel P. Berrangé
@ 2020-08-13 16:32     ` Li Qiang
  2020-08-25  5:59       ` Markus Armbruster
  0 siblings, 1 reply; 7+ messages in thread
From: Li Qiang @ 2020-08-13 16:32 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: zxq_yx_007, marcandre lureau, Li Qiang, Qemu Developers

Daniel P. Berrangé <berrange@redhat.com> 于2020年6月24日周三 下午6:56写道:
>
> On Thu, Jun 18, 2020 at 02:12:58PM +0800, Li Qiang wrote:
> > Ping..
> > Anyone queued this?
>
> Thanks, I've queud this now.

Hi Daniel,
It seems this patch still not in the upstream.

Thanks,
Li Qiang

>
> >
> > Thanks,
> > Li Qiang
> >
> > Li Qiang <liq3ea@163.com> 于2020年6月4日周四 上午12:31写道:
> >
> > > After build qemu with '-fsanitize=address' extra-cflags,
> > > 'make check' show following leak:
> > >
> > > =================================================================
> > > ==44580==ERROR: LeakSanitizer: detected memory leaks
> > >
> > > Direct leak of 2500 byte(s) in 1 object(s) allocated from:
> > >     #0 0x7f1b5a8b8d28 in __interceptor_calloc
> > > (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
> > >     #1 0x7f1b5a514b10 in g_malloc0
> > > (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51b10)
> > >     #2 0xd79ea4e4c0ad31c3  (<unknown module>)
> > >
> > > SUMMARY: AddressSanitizer: 2500 byte(s) leaked in 1 allocation(s).
> > >
> > > Call 'g_rand_free' in the end of function to avoid this.
> > >
> > > Fixes: 4d3a329af59("tests/util-sockets: add abstract unix socket cases")
> > > Signed-off-by: Li Qiang <liq3ea@163.com>
> > > ---
> > >  tests/test-util-sockets.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c
> > > index 2ca1e99f17..ca6671f9bf 100644
> > > --- a/tests/test-util-sockets.c
> > > +++ b/tests/test-util-sockets.c
> > > @@ -312,6 +312,7 @@ static void test_socket_unix_abstract_good(void)
> > >      g_thread_join(serv);
> > >
> > >      g_free(abstract_sock_name);
> > > +    g_rand_free(r);
> > >  }
> > >  #endif
> > >
> > > --
> > > 2.17.1
> > >
> > >
> > >
>
> Regards,
> Daniel
> --
> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] tests: fix a memory in test_socket_unix_abstract_good
  2020-08-13 16:32     ` Li Qiang
@ 2020-08-25  5:59       ` Markus Armbruster
  0 siblings, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2020-08-25  5:59 UTC (permalink / raw)
  To: Li Qiang
  Cc: Daniel P. Berrangé,
	zxq_yx_007, Li Qiang, Qemu Developers, qemu-trivial,
	marcandre lureau

Li Qiang <liq3ea@gmail.com> writes:

> Hi Daniel,
> It seems this patch still not in the upstream.

Cc: qemu-trivial, hope this helps.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-25  6:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 16:14 [PATCH] tests: fix a memory in test_socket_unix_abstract_good Li Qiang
2020-06-03 17:25 ` Philippe Mathieu-Daudé
2020-06-03 23:10 ` xiaoqiang zhao
2020-06-18  6:12 ` Li Qiang
2020-06-24 10:56   ` Daniel P. Berrangé
2020-08-13 16:32     ` Li Qiang
2020-08-25  5:59       ` Markus Armbruster

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.