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

Masatake YAMATO yamato at redhat.com
Wed Apr 16 07:26:28 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).

In the new patch tcp->s_ent is never referred in finalization stage.
So the this issue is gone now. 

[PATCH v4 08/37] unwind: introduce queue_t for capturing stacktrace

Thanks.
Masatake YAMATO

> 
> -- 
> ldv




More information about the Strace-devel mailing list