Skip to contentSkip to conversation

migration: fix pfd leak

PATCH In review Marc-André Lureau 4 participants 4 messages Mar 21, 2018 – Mar 29, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 migration: fix pfd leak

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.

---
 migration/postcopy-ram.c | 1 +
 1 file changed, 1 insertion(+)
migration/postcopy-ram.c +1 -0
index efd77939af..4a0b33b373 100644
@@ -754,6 +754,7 @@ static void *postcopy_ram_fault_thread(void *opaque)
         }
     }
     trace_postcopy_ram_fault_thread_exit();
+    g_free(pfd);
     return NULL;
 }
 
Signature · 1 line
2.16.2.521.g9aa15f885a
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Marc-André Lureau

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)
Quoted 3 lines

Regression introduced with commit 00fa4fc85b00f1a8a810068d158a7a66e88658eb.

Quoted 17 lines
---
 migration/postcopy-ram.c | 1 +
 1 file changed, 1 insertion(+)
migration/postcopy-ram.c +1 -0
index efd77939af..4a0b33b373 100644
@@ -754,6 +754,7 @@ static void *postcopy_ram_fault_thread(void *opaque)
         }
     }
     trace_postcopy_ram_fault_thread_exit();
+    g_free(pfd);
     return NULL;
 }
 
Reviewed-by on v1 1/1
#2 lore raw
In reply to Marc-André Lureau
Quoted 10 lines · Marc-André Lureau

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)
Quoted 3 lines

Regression introduced with commit 00fa4fc85b00f1a8a810068d158a7a66e88658eb.

Signature · 1 line
Peter Xu
#3 lore raw
In reply to Marc-André Lureau
Quoted 10 lines · * Marc-André Lureau ([email protected]) 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)
Quoted 3 lines

Regression introduced with commit 00fa4fc85b00f1a8a810068d158a7a66e88658eb.

Queued

Quoted 19 lines
---
 migration/postcopy-ram.c | 1 +
 1 file changed, 1 insertion(+)
migration/postcopy-ram.c +1 -0
index efd77939af..4a0b33b373 100644
@@ -754,6 +754,7 @@ static void *postcopy_ram_fault_thread(void *opaque)
         }
     }
     trace_postcopy_ram_fault_thread_exit();
+    g_free(pfd);
     return NULL;
 }
 
Signature · 1 line
2.16.2.521.g9aa15f885a

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK