mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
util: do not unref event thread after joining it
g_thread_join() eats a reference. ==295055== Invalid read of size 4 ==295055== at 0x4DA4AE4: g_thread_unref (in /usr/lib64/libglib-2.0.so.0.6400.5) ==295055== by 0x491D5FA: vir_event_thread_finalize (vireventthread.c:47) ==295055== by 0x4E6BCFF: g_object_unref (in /usr/lib64/libgobject-2.0.so.0.6400.5) ==295055== by 0x22F35CF4: qemuProcessQMPFree (qemu_process.c:8525) ==295055== by 0x22E71B58: glib_autoptr_clear_qemuProcessQMP (qemu_process.h:237) ... ==295055== by 0x22E98A29: qemuDomainPostParseDataAlloc (qemu_domain.c:5476) ==295055== by 0x49ABF83: virDomainDefPostParse (domain_conf.c:6023) ==295055== Address 0x2acb1c68 is 24 bytes inside a block of size 88 free'd ==295055== at 0x483B9F5: free (vg_replace_malloc.c:538) ==295055== by 0x4D80A4C: g_free (in /usr/lib64/libglib-2.0.so.0.6400.5) ... ==295055== by 0x491D5F1: vir_event_thread_finalize (vireventthread.c:46) ==295055== by 0x4E6BCFF: g_object_unref (in /usr/lib64/libgobject-2.0.so.0.6400.5) ==295055== by 0x22F35CF4: qemuProcessQMPFree (qemu_process.c:8525) ==295055== by 0x22E71B58: glib_autoptr_clear_qemuProcessQMP (qemu_process.h:237) ... ==295055== Block was alloc'd at ==295055== at 0x483A809: malloc (vg_replace_malloc.c:307) ==295055== by 0x4D80958: g_malloc (in /usr/lib64/libglib-2.0.so.0.6400.5) ... ==295055== by 0x4DA4C32: g_thread_try_new (in /usr/lib64/libglib-2.0.so.0.6400.5) ==295055== by 0x491D3BC: virEventThreadStart (vireventthread.c:159) ==295055== by 0x491D3BC: virEventThreadNew (vireventthread.c:185) ... Signed-off-by: Ján Tomko <jtomko@redhat.com> Fixes: f4fc3db9204407874181117085756c9ced78adad Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
5eed9a6ab3
commit
cc622d25e6
@ -44,7 +44,6 @@ vir_event_thread_finalize(GObject *object)
|
||||
if (evt->thread) {
|
||||
g_main_loop_quit(evt->loop);
|
||||
g_thread_join(evt->thread);
|
||||
g_thread_unref(evt->thread);
|
||||
}
|
||||
|
||||
g_main_loop_unref(evt->loop);
|
||||
|
Loading…
x
Reference in New Issue
Block a user