PTRACE_ATTACH breaks wait4()

Pavel Kankovsky (peak@argo.troja.mff.cuni.cz)
Thu, 7 Jun 2001 22:39:43 +0200 (MET DST)


Let A be a process and B its child. When another process, let's call
it C, does ptrace(PTRACE_ATTACH) on B, wait4(pid of B, ...) will always
return ECHILD when invoked from A after B has been attached to C because
wait4() does not take children traced by other processes into account.
The problem was observed on 2.2.19. I suppose it exists in 2.4 as well.

Apparently, I am not the first person who encountered this problem. See
<http://www.uwsg.indiana.edu/hypermail/linux/kernel/9901.3/0869.html>

--Pavel Kankovsky aka Peak [ Boycott Microsoft--http://www.vcnet.com/bms ]
"Resistance is futile. Open your source code and prepare for assimilation."

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/