qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] migrate/multifd: fix coredump when the multifd thread cleanup
@ 2023-06-21  8:18 z00619469 via
  2023-06-21 13:24 ` Peter Xu
  2023-06-21 14:22 ` Fabiano Rosas
  0 siblings, 2 replies; 9+ messages in thread
From: z00619469 via @ 2023-06-21  8:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: chenyuhui5, xuyinghua3, liheng.liheng, renxuming, pengyi.pengyi,
	yubihong, zhengchuan, huhao33

From: c00454449 <chenyuhui5@huawei.com>

There is a coredump while trying to destroy mutex when
p->running is false but p->mutex is not unlock.
Make sure all mutexes has been released before destroy them.

Signed-off-by: c00454449 <chenyuhui5@huawei.com>
---
 migration/multifd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/migration/multifd.c b/migration/multifd.c
index b7ad7002e0..7dcdb2d3a0 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -523,9 +523,7 @@ void multifd_save_cleanup(void)
     for (i = 0; i < migrate_multifd_channels(); i++) {
         MultiFDSendParams *p = &multifd_send_state->params[i];
 
-        if (p->running) {
-            qemu_thread_join(&p->thread);
-        }
+        qemu_thread_join(&p->thread);
     }
     for (i = 0; i < migrate_multifd_channels(); i++) {
         MultiFDSendParams *p = &multifd_send_state->params[i];
@@ -1040,8 +1038,8 @@ int multifd_load_cleanup(Error **errp)
              * however try to wakeup it without harm in cleanup phase.
              */
             qemu_sem_post(&p->sem_sync);
-            qemu_thread_join(&p->thread);
         }
+        qemu_thread_join(&p->thread);
     }
     for (i = 0; i < migrate_multifd_channels(); i++) {
         MultiFDRecvParams *p = &multifd_recv_state->params[i];
-- 
2.21.0.windows.1



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

end of thread, other threads:[~2023-08-14 14:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-21  8:18 [PATCH] migrate/multifd: fix coredump when the multifd thread cleanup z00619469 via
2023-06-21 13:24 ` Peter Xu
2023-06-21 14:22 ` Fabiano Rosas
2023-06-26 13:16   ` chenyuhui (A) via
2023-06-27  1:11     ` chenyuhui (A) via
2023-07-25  8:43       ` chenyuhui (A) via
2023-07-25 16:53         ` Peter Xu
2023-07-27  1:46           ` chenyuhui (A) via
2023-08-14 14:55             ` Fabiano Rosas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).