1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | [dyu@xilinuxbldsrv purify]$ pstack 6721 Thread 5 (Thread 0x41e37940 (LWP 6722)): #0 0x0000003d1a80d4c4 in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x0000003d1a808e1a in _L_lock_1034 () from /lib64/libpthread.so.0 #2 0x0000003d1a808cdc in pthread_mutex_lock () from /lib64/libpthread.so.0 #3 0x0000000000400a9b in func1() () #4 0x0000000000400ad7 in thread1(void*) () #5 0x0000003d1a80673d in start_thread () from /lib64/libpthread.so.0 #6 0x0000003d19cd40cd in clone () from /lib64/libc.so.6 Thread 4 (Thread 0x42838940 (LWP 6723)): #0 0x0000003d1a80d4c4 in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x0000003d1a808e1a in _L_lock_1034 () from /lib64/libpthread.so.0 #2 0x0000003d1a808cdc in pthread_mutex_lock () from /lib64/libpthread.so.0 #3 0x0000000000400a17 in func2() () #4 0x0000000000400a53 in thread2(void*) () #5 0x0000003d1a80673d in start_thread () from /lib64/libpthread.so.0 #6 0x0000003d19cd40cd in clone () from /lib64/libc.so.6 Thread 3 (Thread 0x43239940 (LWP 6724)): #0 0x0000003d19c9a541 in nanosleep () from /lib64/libc.so.6 #1 0x0000003d19c9a364 in sleep () from /lib64/libc.so.6 #2 0x00000000004009bc in thread3(void*) () #3 0x0000003d1a80673d in start_thread () from /lib64/libpthread.so.0 #4 0x0000003d19cd40cd in clone () from /lib64/libc.so.6 Thread 2 (Thread 0x43c3a940 (LWP 6725)): #0 0x0000003d19c9a541 in nanosleep () from /lib64/libc.so.6 #1 0x0000003d19c9a364 in sleep () from /lib64/libc.so.6 #2 0x0000000000400976 in thread4(void*) () #3 0x0000003d1a80673d in start_thread () from /lib64/libpthread.so.0 #4 0x0000003d19cd40cd in clone () from /lib64/libc.so.6 Thread 1 (Thread 0x2b984ecabd90 (LWP 6721)): #0 0x0000003d1a807b35 in pthread_join () from /lib64/libpthread.so.0 #1 0x0000000000400900 in main () |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | [dyu@xilinuxbldsrv purify]$ pstack 6721 Thread 5 (Thread 0x40bd6940 (LWP 6722)): #0 0x0000003d1a80d4c4 in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x0000003d1a808e1a in _L_lock_1034 () from /lib64/libpthread.so.0 #2 0x0000003d1a808cdc in pthread_mutex_lock () from /lib64/libpthread.so.0 #3 0x0000000000400a87 in func1() () #4 0x0000000000400ac3 in thread1(void*) () #5 0x0000003d1a80673d in start_thread () from /lib64/libpthread.so.0 #6 0x0000003d19cd40cd in clone () from /lib64/libc.so.6 Thread 4 (Thread 0x415d7940 (LWP 6723)): #0 0x0000003d1a80d4c4 in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x0000003d1a808e1a in _L_lock_1034 () from /lib64/libpthread.so.0 #2 0x0000003d1a808cdc in pthread_mutex_lock () from /lib64/libpthread.so.0 #3 0x0000000000400a03 in func2() () #4 0x0000000000400a3f in thread2(void*) () #5 0x0000003d1a80673d in start_thread () from /lib64/libpthread.so.0 #6 0x0000003d19cd40cd in clone () from /lib64/libc.so.6 Thread 3 (Thread 0x41fd8940 (LWP 6724)): #0 0x0000003d19c7aec2 in memset () from /lib64/libc.so.6 #1 0x00000000004009be in thread3(void*) () #2 0x0000003d1a80673d in start_thread () from /lib64/libpthread.so.0 #3 0x0000003d19cd40cd in clone () from /lib64/libc.so.6 Thread 2 (Thread 0x429d9940 (LWP 6725)): #0 0x0000003d19c7ae0d in memset () from /lib64/libc.so.6 #1 0x0000000000400982 in thread4(void*) () #2 0x0000003d1a80673d in start_thread () from /lib64/libpthread.so.0 #3 0x0000003d19cd40cd in clone () from /lib64/libc.so.6 Thread 1 (Thread 0x2af906fd9d90 (LWP 6721)): #0 0x0000003d1a807b35 in pthread_join () from /lib64/libpthread.so.0 #1 0x0000000000400900 in main () |
1 2 3 4 5 6 7 8 9 10 11 | (gdb) info thread 5 Thread 0x41e37940 (LWP 6722) 0x0000003d1a80d4c4 in __lll_lock_wait () from /lib64/libpthread.so.0 4 Thread 0x42838940 (LWP 6723) 0x0000003d1a80d4c4 in __lll_lock_wait () from /lib64/libpthread.so.0 3 Thread 0x43239940 (LWP 6724) 0x0000003d19c9a541 in nanosleep () from /lib64/libc.so.6 2 Thread 0x43c3a940 (LWP 6725) 0x0000003d19c9a541 in nanosleep () from /lib64/libc.so.6 * 1 Thread 0x2b984ecabd90 (LWP 6721) 0x0000003d1a807b35 in pthread_join () from /lib64/libpthread.so.0 |
1 2 3 4 5 6 7 8 9 10 11 | (gdb) thread 5 [Switching to thread 5 (Thread 0x41e37940 (LWP 6722))]#0 0x0000003d1a80d4c4 in __lll_lock_wait () from /lib64/libpthread.so.0 (gdb) where #0 0x0000003d1a80d4c4 in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x0000003d1a808e1a in _L_lock_1034 () from /lib64/libpthread.so.0 #2 0x0000003d1a808cdc in pthread_mutex_lock () from /lib64/libpthread.so.0 #3 0x0000000000400a9b in func1 () at lock.cpp:18 #4 0x0000000000400ad7 in thread1 (arg=0x0) at lock.cpp:43 #5 0x0000003d1a80673d in start_thread () from /lib64/libpthread.so.0 #6 0x0000003d19cd40cd in clone () from /lib64/libc.so.6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | (gdb) f 3 #3 0x0000000000400a9b in func1 () at lock.cpp:18 18 pthread_mutex_lock(&mutex2); (gdb) thread 4 [Switching to thread 4 (Thread 0x42838940 (LWP 6723))]#0 0x0000003d1a80d4c4 in __lll_lock_wait () from /lib64/libpthread.so.0 (gdb) f 3 #3 0x0000000000400a17 in func2 () at lock.cpp:31 31 pthread_mutex_lock(&mutex1); (gdb) p mutex1 $1 = {__data = {__lock = 2, __count = 0, __owner = 6722, __nusers = 1, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = "\002\000\000\000\000\000\000\000B\032\000\000\001", '\000' <repeats 26 times>, __align = 2} (gdb) p mutex3 $2 = {__data = {__lock = 0, __count = 0, __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0} (gdb) p mutex2 $3 = {__data = {__lock = 2, __count = 0, __owner = 6723, __nusers = 1, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = "\002\000\000\000\000\000\000\000C\032\000\000\001", '\000' <repeats 26 times>, __align = 2} (gdb) |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |