diff mbox series

migration: fix pfd leak

Message ID 20180321113644.21899-1-marcandre.lureau@redhat.com
State New
Headers show
Series migration: fix pfd leak | expand

Commit Message

Marc-André Lureau March 21, 2018, 11:36 a.m. UTC
Fix leak spotted by ASAN:

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7fe1abb80a38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38)
    #1 0x7fe1aaf1bf75 in g_malloc0 ../glib/gmem.c:124
    #2 0x7fe1aaf1c249 in g_malloc0_n ../glib/gmem.c:355
    #3 0x55f4841cfaa9 in postcopy_ram_fault_thread /home/elmarco/src/qemu/migration/postcopy-ram.c:596
    #4 0x55f48479447b in qemu_thread_start /home/elmarco/src/qemu/util/qemu-thread-posix.c:504
    #5 0x7fe1a043550a in start_thread (/lib64/libpthread.so.0+0x750a)

Regression introduced with commit 00fa4fc85b00f1a8a810068d158a7a66e88658eb.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 migration/postcopy-ram.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Philippe Mathieu-Daudé March 21, 2018, 2:42 p.m. UTC | #1
On 03/21/2018 12:36 PM, Marc-André Lureau wrote:
> Fix leak spotted by ASAN:
> 
> Direct leak of 16 byte(s) in 1 object(s) allocated from:
>     #0 0x7fe1abb80a38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38)
>     #1 0x7fe1aaf1bf75 in g_malloc0 ../glib/gmem.c:124
>     #2 0x7fe1aaf1c249 in g_malloc0_n ../glib/gmem.c:355
>     #3 0x55f4841cfaa9 in postcopy_ram_fault_thread /home/elmarco/src/qemu/migration/postcopy-ram.c:596
>     #4 0x55f48479447b in qemu_thread_start /home/elmarco/src/qemu/util/qemu-thread-posix.c:504
>     #5 0x7fe1a043550a in start_thread (/lib64/libpthread.so.0+0x750a)
> 
> Regression introduced with commit 00fa4fc85b00f1a8a810068d158a7a66e88658eb.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  migration/postcopy-ram.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
> index efd77939af..4a0b33b373 100644
> --- a/migration/postcopy-ram.c
> +++ b/migration/postcopy-ram.c
> @@ -754,6 +754,7 @@ static void *postcopy_ram_fault_thread(void *opaque)
>          }
>      }
>      trace_postcopy_ram_fault_thread_exit();
> +    g_free(pfd);
>      return NULL;
>  }
>  
>
Peter Xu March 22, 2018, 3:12 a.m. UTC | #2
On Wed, Mar 21, 2018 at 12:36:44PM +0100, Marc-André Lureau wrote:
> Fix leak spotted by ASAN:
> 
> Direct leak of 16 byte(s) in 1 object(s) allocated from:
>     #0 0x7fe1abb80a38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38)
>     #1 0x7fe1aaf1bf75 in g_malloc0 ../glib/gmem.c:124
>     #2 0x7fe1aaf1c249 in g_malloc0_n ../glib/gmem.c:355
>     #3 0x55f4841cfaa9 in postcopy_ram_fault_thread /home/elmarco/src/qemu/migration/postcopy-ram.c:596
>     #4 0x55f48479447b in qemu_thread_start /home/elmarco/src/qemu/util/qemu-thread-posix.c:504
>     #5 0x7fe1a043550a in start_thread (/lib64/libpthread.so.0+0x750a)
> 
> Regression introduced with commit 00fa4fc85b00f1a8a810068d158a7a66e88658eb.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Reviewed-by: Peter Xu <peterx@redhat.com>
Dr. David Alan Gilbert March 29, 2018, 9:23 a.m. UTC | #3
* Marc-André Lureau (marcandre.lureau@redhat.com) wrote:
> Fix leak spotted by ASAN:
> 
> Direct leak of 16 byte(s) in 1 object(s) allocated from:
>     #0 0x7fe1abb80a38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38)
>     #1 0x7fe1aaf1bf75 in g_malloc0 ../glib/gmem.c:124
>     #2 0x7fe1aaf1c249 in g_malloc0_n ../glib/gmem.c:355
>     #3 0x55f4841cfaa9 in postcopy_ram_fault_thread /home/elmarco/src/qemu/migration/postcopy-ram.c:596
>     #4 0x55f48479447b in qemu_thread_start /home/elmarco/src/qemu/util/qemu-thread-posix.c:504
>     #5 0x7fe1a043550a in start_thread (/lib64/libpthread.so.0+0x750a)
> 
> Regression introduced with commit 00fa4fc85b00f1a8a810068d158a7a66e88658eb.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Queued

> ---
>  migration/postcopy-ram.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
> index efd77939af..4a0b33b373 100644
> --- a/migration/postcopy-ram.c
> +++ b/migration/postcopy-ram.c
> @@ -754,6 +754,7 @@ static void *postcopy_ram_fault_thread(void *opaque)
>          }
>      }
>      trace_postcopy_ram_fault_thread_exit();
> +    g_free(pfd);
>      return NULL;
>  }
>  
> -- 
> 2.16.2.521.g9aa15f885a
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
diff mbox series

Patch

diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index efd77939af..4a0b33b373 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -754,6 +754,7 @@  static void *postcopy_ram_fault_thread(void *opaque)
         }
     }
     trace_postcopy_ram_fault_thread_exit();
+    g_free(pfd);
     return NULL;
 }