chxj19 commented on issue #900: 如何在bthread_mutex_t死锁问题时查看bthread的堆栈
URL: https://github.com/apache/incubator-brpc/issues/900#issuecomment-525184422
 
 
   昨天的没有了,我今天在同样的地方构造了死锁,但是今天的除了其中3个frame可以看到报错之外其他的frame都没有任何输出了。
   
   下面有bthread_list的结果以及bthread_frame和bthread_meta的输出信息
   
   ```
   (gdb) bthread_list 
   id      tid     function total:10
   #0      4294969600      0x96ede0 <brpc::GlobalUpdate(void*)>
   #1      4294969601      0x8c6900 <mds::LBAGarbageProc::thread_fn(void*)>
   #2      4294969602      0xa2b660 
<brpc::SocketMap::RunWatchConnections(void*)>
   #3      4294969603      0x96e850 <brpc::EventDispatcher::RunThis(void*)>
   #4      4294969604      0xa10940 <brpc::Server::UpdateDerivedVars(void*)>
   #5      12884904449     0xa1f2a0 <brpc::Socket::ProcessEvent(void*)>
   #6      8589941249      0x977510 <brpc::ProcessInputMessage(void*)>
   #7      4294973954      0x8eb770 <mds::SITCache::update_sit_container(void*)>
   #8      4294973957      0x977510 <brpc::ProcessInputMessage(void*)>
   #9      4294973958      0x977510 <brpc::ProcessInputMessage(void*)>
   
   (gdb) bthread_frame 0
   Python Exception <class 'gdb.MemoryError'> Cannot access memory at address 
0x100000007: 
   Error occurred in Python command: Cannot access memory at address 0x100000007
   (gdb) bthread_frame 1
   (gdb) bthread_frame 2
   Python Exception <class 'gdb.MemoryError'> Cannot access memory at address 
0x8: 
   Error occurred in Python command: Cannot access memory at address 0x8
   (gdb) bthread_frame 3
   Python Exception <class 'gdb.MemoryError'> Cannot access memory at address 
0x8: 
   Error occurred in Python command: Cannot access memory at address 0x8
   (gdb) bthread_frame 4
   (gdb) bthread_frame 5
   (gdb) bthread_frame 6
   (gdb) bthread_frame 7
   (gdb) bthread_frame 8
   (gdb) bthread_frame 9
   (gdb) 
   
   (gdb) bthread_meta 0
   {current_waiter = {<std::atomic<bthread::ButexWaiter*>> = {_M_b = {_M_p = 
0x0}}, <No data fields>}, current_sleep = 8589935890, stop = false, interrupted 
= false, about_to_quit = false, version_lock = 1, version_butex = 0x367c800, 
tid = 4294969600, fn = 0x96ede0 <brpc::GlobalUpdate(void*)>, arg = 0x0, stack = 
0x34f0b00, attr = {stack_type = 3, flags = 0, keytable_pool = 0x0}, 
cpuwide_start_ns = 772045948636962, stat = {cputime_ns = 446514, nswitch = 18}, 
local_storage = {keytable = 0x0, assigned_data = 0x0, rpcz_parent_span = 0x0}}
   (gdb) bthread_meta 1
   {current_waiter = {<std::atomic<bthread::ButexWaiter*>> = {_M_b = {_M_p = 
0x0}}, <No data fields>}, current_sleep = 0, stop = false, interrupted = false, 
about_to_quit = false, version_lock = 1, version_butex = 0x367ca40, tid = 
4294969601, fn = 0x8c6900 <mds::LBAGarbageProc::thread_fn(void*)>, arg = 
0x344f5e8, stack = 0x34f0b28, attr = {stack_type = 3, flags = 0, keytable_pool 
= 0x0}, cpuwide_start_ns = 772045949769170, stat = {cputime_ns = 0, nswitch = 
0}, local_storage = {keytable = 0x0, assigned_data = 0x0, rpcz_parent_span = 
0x0}}
   (gdb) bthread_meta 2
   {current_waiter = {<std::atomic<bthread::ButexWaiter*>> = {_M_b = {_M_p = 
0x0}}, <No data fields>}, current_sleep = 8589936146, stop = false, interrupted 
= false, about_to_quit = false, version_lock = 1, version_butex = 0x367ca80, 
tid = 4294969602, fn = 0xa2b660 <brpc::SocketMap::RunWatchConnections(void*)>, 
arg = 0x32caa50, stack = 0x34f2c00, attr = {stack_type = 3, flags = 0, 
keytable_pool = 0x0}, cpuwide_start_ns = 772045951715982, stat = {cputime_ns = 
209589, nswitch = 18}, local_storage = {keytable = 0x0, assigned_data = 0x0, 
rpcz_parent_span = 0x0}}
   (gdb) bthread_meta 3
   {current_waiter = {<std::atomic<bthread::ButexWaiter*>> = {_M_b = {_M_p = 
0x0}}, <No data fields>}, current_sleep = 0, stop = false, interrupted = false, 
about_to_quit = false, version_lock = 1, version_butex = 0x367d800, tid = 
4294969603, fn = 0x96e850 <brpc::EventDispatcher::RunThis(void*)>, arg = 
0x34f6208, stack = 0x3e8a000, attr = {stack_type = 3, flags = 0, keytable_pool 
= 0x0}, cpuwide_start_ns = 772045959472239, stat = {cputime_ns = 2857446521, 
nswitch = 7}, local_storage = {keytable = 0x0, assigned_data = 0x0, 
rpcz_parent_span = 0x0}}
   (gdb) bthread_meta 4
   {current_waiter = {<std::atomic<bthread::ButexWaiter*>> = {_M_b = {_M_p = 
0x0}}, <No data fields>}, current_sleep = 8589936402, stop = false, interrupted 
= false, about_to_quit = false, version_lock = 1, version_butex = 0x367d840, 
tid = 4294969604, fn = 0xa10940 <brpc::Server::UpdateDerivedVars(void*)>, arg = 
0x7fffea07e680, stack = 0x3e90000, attr = {stack_type = 3, flags = 0, 
keytable_pool = 0x0}, cpuwide_start_ns = 772045959486570, stat = {cputime_ns = 
7087921, nswitch = 18}, local_storage = {keytable = 0x0, assigned_data = 0x0, 
rpcz_parent_span = 0x0}}
   (gdb) bthread_meta 5
   {current_waiter = {<std::atomic<bthread::ButexWaiter*>> = {_M_b = {_M_p = 
0x7f8df213ce00}}, <No data fields>}, current_sleep = 0, stop = false, 
interrupted = false, about_to_quit = false, version_lock = 1, version_butex = 
0x3ca41c0, tid = 4294974466, fn = 0x8eb770 
<mds::SITCache::update_sit_container(void*)>, arg = 0x40e0ce0, stack = 
0x3e94d00, attr = {stack_type = 3, flags = 0, keytable_pool = 0x0}, 
cpuwide_start_ns = 772048607359328, stat = {cputime_ns = 2741907, nswitch = 
147}, local_storage = {keytable = 0x41a2a00, assigned_data = 0x0, 
rpcz_parent_span = 0x0}}
   (gdb) bthread_meta 6
   {current_waiter = {<std::atomic<bthread::ButexWaiter*>> = {_M_b = {_M_p = 
0x0}}, <No data fields>}, current_sleep = 0, stop = false, interrupted = false, 
about_to_quit = false, version_lock = 1, version_butex = 0x3ca6440, tid = 
4294974721, fn = 0xa1f2a0 <brpc::Socket::ProcessEvent(void*)>, arg = 0x4022000, 
stack = 0x3e92128, attr = {stack_type = 3, flags = 0, keytable_pool = 
0x34f69c0}, cpuwide_start_ns = 772048817406440, stat = {cputime_ns = 0, nswitch 
= 0}, local_storage = {keytable = 0x3b29d00, assigned_data = 0x0, 
rpcz_parent_span = 0x0}}
   
   (gdb) bthread_meta 7
   {current_waiter = {<std::atomic<bthread::ButexWaiter*>> = {_M_b = {_M_p = 
0x7f8df4d45ac0}}, <No data fields>}, current_sleep = 0, stop = false, 
interrupted = false, about_to_quit = false, version_lock = 1, version_butex = 
0x3ca6480, tid = 4294974722, fn = 0x977510 <brpc::ProcessInputMessage(void*)>, 
arg = 0x4d00000, stack = 0x3e92c00, attr = {stack_type = 3, flags = 32, 
keytable_pool = 0x34f69c0}, cpuwide_start_ns = 772048817466559, stat = 
{cputime_ns = 52994, nswitch = 1}, local_storage = {keytable = 0x3b28700, 
assigned_data = 0x0, rpcz_parent_span = 0x0}}
   (gdb) bthread_meta 8
   {current_waiter = {<std::atomic<bthread::ButexWaiter*>> = {_M_b = {_M_p = 
0x0}}, <No data fields>}, current_sleep = 0, stop = false, interrupted = false, 
about_to_quit = false, version_lock = 1, version_butex = 0x3ca64c0, tid = 
4294974723, fn = 0x977510 <brpc::ProcessInputMessage(void*)>, arg = 0x4d00080, 
stack = 0x3e92c28, attr = {stack_type = 3, flags = 32, keytable_pool = 
0x34f69c0}, cpuwide_start_ns = 772048817468086, stat = {cputime_ns = 0, nswitch 
= 0}, local_storage = {keytable = 0x41a2f00, assigned_data = 0x0, 
rpcz_parent_span = 0x0}}
   (gdb) bthread_meta 9
   {current_waiter = {<std::atomic<bthread::ButexWaiter*>> = {_M_b = {_M_p = 
0x0}}, <No data fields>}, current_sleep = 0, stop = false, interrupted = false, 
about_to_quit = false, version_lock = 1, version_butex = 0x3ca6500, tid = 
4294974724, fn = 0x977510 <brpc::ProcessInputMessage(void*)>, arg = 0x4d00100, 
stack = 0x3e8cc00, attr = {stack_type = 3, flags = 32, keytable_pool = 
0x34f69c0}, cpuwide_start_ns = 772048817477545, stat = {cputime_ns = 0, nswitch 
= 0}, local_storage = {keytable = 0x3727800, assigned_data = 0x0, 
rpcz_parent_span = 0x0}}
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to