[LTP] [PATCH 1/2] pids: fix cleanup of orphaned pids_task1 children

Li Wang li.wang@linux.dev
Tue Jun 16 09:32:23 CEST 2026


> From: Andrea Cervesato <andrea.cervesato@suse.com>
> 
> pids_task1 forks a child that calls pause(), then the parent exits.
> The orphaned child remains in the cgroup but gets reparented to init,
> so it is not a child of the test shell.
> 
> stop_pids_tasks_path() reads cgroup.procs which includes this orphan.
> kill -9 succeeds but wait fails with 'not a child of this shell'.
> Using ROD for kill also unnecessarily aborts if the process is already
> dead.
> 
> Fix by suppressing errors from both kill and wait, and add killall
> for pids_task1 in cleanup() to catch any remaining orphans.
> 
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>

Reviewed-by: Li Wang <li.wang@linux.dev>

-- 
Regards,
Li Wang


More information about the ltp mailing list