BUG: NTPL: waitpid() doesn't return?

Matthias Urlichs smurf at smurf.noris.de
Sat Jan 31 14:41:01 UTC 2004


Hi,

[ Cc to strace-devel ... see below ]

> > Those "Process ### suspended" messages did NOT happen with the Python
> > script that exhibits the bug.
> 
> This is an strace bug.  Because of goofy ptrace interactions, strace does
> funny business with threads doing wait calls.  strace should resume those
> threads when the pids they are waiting for exit.  
> 
I use Debian 4.5-1. Is there a newer version?

> To research the issue thoroughly, you may have to avoid relying on strace
> to tell you what calls your programs make.

Hmm. What triggers strace to stop (or not) processes which do waidpid()?

Not using strace is a bit difficult, as exhibited by the fact that a
program's fork() call is translated to a clone() by glibc, so I can't
see what's happening.


Anyway, on my dual PIII here, tracing the attached program is
highly nondeterministic -- in that it sometimes crashes:

$ strace -f -o /tmp/tep  $HOME/tepr
Thread 0 Launched pid 18095
Thread 2 Launched pid 18100
Thread 3 Launched pid 18105
Thread 1 Launched pid 18099
Thread 4 Launched pid 18107
Thread 5 Launched pid 18110
Thread 6 Launched pid 18113
Thread 7 Launched pid 18116
Thread 0 waitpid for 18095 returned for 18095, status: 1
Thread 2 waitpid for 18100 returned for 18100, status: 1
Thread 3 waitpid for 18105 returned for 18105, status: 1
Thread 1 waitpid for 18099 returned for 18099, status: 1
Thread 4 waitpid for 18107 returned for 18107, status: 1
Thread 5 waitpid for 18110 returned for 18110, status: 1
Thread 6 waitpid for 18113 returned for 18113, status: 1
Thread 7 waitpid for 18116 returned for 18116, status: 1
$ strace -f -o /tmp/tep  $HOME/tepr
  [tcb table full]
  ptrace: umoven: No such process
  trace: ptrace(PTRACE_SYSCALL, ...): No such process
$

In other words, sometimes it runs without a problem, sometimes it hangs
while waiting. No such problems are visible on my single-CPU machine.

This is kernel 2.6.2-rc1-smp, no patches; the system runs Debian unstable.

Attached: tepr.c, tep.gz.

-- 
Matthias Urlichs     |     noris network AG     |     http://smurf.noris.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tepr.c
Type: text/x-csrc
Size: 1346 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20040131/d872910a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tep.gz
Type: application/octet-stream
Size: 1839 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20040131/d872910a/attachment.obj>


More information about the Strace-devel mailing list