Bug 8017

Summary: selftest does pkill(qemu) which will kill ALL qemu processes
Product: [QA/Testing] Runtime Testing Reporter: Ross Burton <ross.burton>
Component: generalAssignee: Daniel Istrate <daniel.alexandrux.istrate>
Status: VERIFIED FIXED QA Contact: Lucian Musat <georgex.l.musat>
Severity: normal    
Priority: High CC: cristian.iorga
Version: 1.9   
Target Milestone: 1.9 M2   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on:    
Bug Blocks: 8176    

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