From: Richard Purdie Date: Fri, 5 Oct 2018 11:05:04 +0000 (+0100) Subject: qemurunner: Remove the signal handler before stopping qemu X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~16466 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b63ce7bb83134f84bf07d1075d5ca0d5466ed3d;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git qemurunner: Remove the signal handler before stopping qemu 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 --- diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index c3c643d7107..dfab1bd5f11 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py @@ -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)