Bug 8017 - selftest does pkill(qemu) which will kill ALL qemu processes
Summary: selftest does pkill(qemu) which will kill ALL qemu processes
Status: VERIFIED FIXED
Alias: None
Product: Runtime Testing
Classification: QA/Testing
Component: general (show other bugs)
Version: 1.9
Hardware: All Multiple
: High normal
Target Milestone: 1.9 M2
Assignee: Daniel Istrate
QA Contact: Lucian Musat
URL:
Whiteboard:
Depends on:
Blocks: 8176
  Show dependency tree
 
Reported: 2015-07-16 10:02 UTC by Ross Burton
Modified: 2015-08-17 19:00 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Burton 2015-07-16 10:02:21 UTC
Many of the selftest runs do pkill("qemu") to kill the currently running qemu, but that will kill *all* qemu processes on the machine.

As pexpect is being used, you can do .kill(signal.SIGTERM) or .terminate().
Comment 1 Cristian Iorga 2015-07-20 09:58:21 UTC
Hi, is critical to fix it as soon as possible.
If a technical solution can't be found fast to pkill issue, please revert the changes that trigger it for now.
Comment 2 Ross Burton 2015-07-20 10:41:15 UTC
So the shell trap is only executed when the shell is processing, but when qemu is running the shell is waiting for qemu to return so it doesn't process the trap.  qemu doesn't get the kill so doesn't exit.  Thus, nothing happens.

Instead, send a kill to the entire process group (runqemu and all children) - qemu will exit and then runqemu will cleanup.

From a shell I do this with "pkill -g <pid of runqemu>".  pexpect doesn't expose this ability directly so the idiom would be something like os.killpg(proc_qemu.pid).
Comment 3 Ross Burton 2015-07-23 10:44:06 UTC
Fixed in oe-core f58df3a630b774083934171463b2b07add29dc0e.
Comment 4 Lucian Musat 2015-07-29 13:13:56 UTC
Verified on master 19f77cf586fbee9e67d3698263402b717303c5ec