captured stacktrace is printed in `unwind_tcb_fin' if tcp->queue is not empty. This should happen before printing detached message. So unwind_tcb_fin is moved to the too of `droptcb'.
This is implicitly suggested by Dmitry V. Levin <[email protected]> in patch review process. Signed-off-by: Masatake YAMATO <[email protected]> --- strace.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/strace.c b/strace.c index d066219..8abb4fe 100644 --- a/strace.c +++ b/strace.c @@ -714,6 +714,12 @@ droptcb(struct tcb *tcp) if (tcp->pid == 0) return; +#ifdef USE_LIBUNWIND + if (stack_trace_enabled) { + unwind_tcb_fin(tcp); + } +#endif + nprocs--; if (debug_flag) fprintf(stderr, "dropped tcb for pid %d, %d remain\n", tcp->pid, nprocs); @@ -735,11 +741,6 @@ droptcb(struct tcb *tcp) if (printing_tcp == tcp) printing_tcp = NULL; -#ifdef USE_LIBUNWIND - if (stack_trace_enabled) { - unwind_tcb_fin(tcp); - } -#endif memset(tcp, 0, sizeof(*tcp)); } -- 1.9.0 ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech _______________________________________________ Strace-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/strace-devel
