mbox series

[0/3] runqemu: Fix a deadlock resulting in files left behind

Message ID 20261107-mathieu-master-next-b16487-v1-0-2fe0e7b9b1fb@bootlin.com
Headers show
Series runqemu: Fix a deadlock resulting in files left behind | expand

Message

Mathieu Dubois-Briand Nov. 7, 2026, 1:54 p.m. UTC
Current implementation tries to use subprocess.communicate() on the QEMU
process from the SIGTERM sighandler, while we also have a
subprocess.wait() on this process in the main thread. This will result
in a race that might lead to a deadlock. When run from oeqa, a SIKGILL
is later fired, which will lead to skipping the QA and leaving files
behind.

Fix the deadlock by having the SIGTERM handler only transfer the signal
to QEMU. Clean-up is made later, on the normal exit path.

Also fix another bug leaving half-copied files on a copy failure, and
increase the debug level of SIGKILL traces in oeqa.

To: openembedded-core@lists.openembedded.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>

Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
---
Mathieu Dubois-Briand (3):
      oeqa: qemurunner: Increase verbosity of SIGKILL log
      runqemu: Also remove file when copy failed
      runqemu: Do not run cleanup in signal handler

 meta/lib/oeqa/utils/qemurunner.py |  2 +-
 scripts/runqemu                   | 39 +++++++++++++++++++++------------------
 2 files changed, 22 insertions(+), 19 deletions(-)
---
base-commit: 3a3eef7afb41dd4fbdc92d1ac121baa55eca0a95
change-id: 20261107-mathieu-master-next-b16487-0f5adb247143

Best regards,