Strace hanging processes in combination with CLONE_NEWPID

Bruno Prémont bonbons at linux-vserver.org
Sat Sep 5 20:40:26 UTC 2009


Hi,

I'm running strace-4.5.18 (on Gentoo).

I'm facing unability to strace a process tree with one process in the
middle of the tree calling clone() with CLONE_NEWPID included in the
flags.

Let's name processes Pn:m (n process number, m process' PID namespace)

strace -ff ./namespace-starter

P1:1   clone(flags=...|CLONE_NEWPID|...)=1234
            (P2:2 has pid 1234 in context 1)
P1:1   ... (doing various things)
 P2:2   ... (doing various things)
 P2:2   clone()=2
            (P3:2 has pid 2 in context 2, pid=1235 in context 1)
 P2:2   waitpid(2, 
            (this is fine)

Strace creates a log file .2 (for the last created process) but from
here on nothing happens anymore. Is strace trying to trace a kernel
thread that happens to have pid=2 in context 1?
P3:2 is stuck in 'T' state; P2:2 is waiting on P3:2. Only way to get
things running again is to kill strace though then tracing stops as
well!

Note: strace seems not to know anything about any CLONE_NEW* flags
except for CLONE_NEWNS

Any chance that tracing across PID namespaces has been fixed in git?

Regards,
Bruno




More information about the Strace-devel mailing list