strace fails to trace call stack of clone from pthread_create
Zhouyang Jia
jiazhouyang09 at gmail.com
Sat Oct 27 05:23:31 UTC 2018
Hi everyone,
I find strace fails to trace call stack of clone syscall (called by
pthread_create) in both main thread and child thread.
How to reproduce:
Get a simple pthread_create example:
http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html
Compile: gcc -pthread test_pthread.c -o test_pthread
Trace: strace -k -ff -o test_pthread ./test_pthread
In main thread:
clone(child_stack=0x7f56c52b1ff0,
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID,
parent_tidptr=0x7f56c52b29d0, tls=0x7f56c52b2700,
child_tidptr=0x7f56c52b29d0) = 69700
> /lib/x86_64-linux-gnu/libc-2.23.so(clone+0x31) [0x1073e1]
In child thread:
set_robust_list(0x7f56c52b29e0, 24) = 0
> /lib/x86_64-linux-gnu/libpthread-2.23.so(start_thread+0x64) [0x7654]
> /lib/x86_64-linux-gnu/libc-2.23.so(clone+0x6d) [0x10741d]
We can see the call stacks of both main thread and child thread start from
libc. Is there any way to get the call stack from the main function? I'm
not sure whether this is a bug or not.
Thanks,
Zhouyang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20181027/c7adeb57/attachment.html>
More information about the Strace-devel
mailing list