[PATCH 2/4] ldv/unwind: handle invalid pid

Dmitry V. Levin ldv at altlinux.org
Thu Apr 10 23:20:44 UTC 2014

On Thu, Apr 10, 2014 at 01:52:09AM +0900, Masatake YAMATO wrote:
> In unwind part of tcb finalization, tcp->s_ent
> was accessed to decide whether pending stacktrace in tcp->queue
> should be printed or not.
> However, s_ent can be NULL if invalid pid is given to strace
> as an trace target. Here invalid pid means that the pid is
> not associated with any process.

tcp->s_ent can be NULL iff either trace_syscall_entering hasn't been
called for this tcp yet, or the process disappeared before the first
trace_syscall_entering call for this tcp.

Another approach to fix this bug is to move unwind_tcb_init call from
alloctcb to the point where its result is going to be used for the first
time (unwind_stacktrace_capture and unwind_stacktrace_print).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20140411/faec909d/attachment.bin>

More information about the Strace-devel mailing list