]> code.ossystems Code Review - openembedded-core.git/commitdiff
qemurunner: Remove the signal handler before stopping qemu
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 5 Oct 2018 11:05:04 +0000 (12:05 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 9 Oct 2018 11:02:41 +0000 (12:02 +0100)
The qemu shutdown can race with the signal handler removal leading to
confusing tracebacks on slower/loaded systems.

Remove the signal handler first before shutting down.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/qemurunner.py

index c3c643d71074ecb94a3c4ab36839b89aaef158e6..dfab1bd5f11e65d438cf8b699719939d65479537 100644 (file)
@@ -350,10 +350,10 @@ class QemuRunner:
         return True
 
     def stop(self):
-        self.stop_thread()
-        self.stop_qemu_system()
         if hasattr(self, "origchldhandler"):
             signal.signal(signal.SIGCHLD, self.origchldhandler)
+        self.stop_thread()
+        self.stop_qemu_system()
         if self.runqemu:
             if hasattr(self, "monitorpid"):
                 os.kill(self.monitorpid, signal.SIGKILL)