异常死锁问题定位

一、根据log或现象初步判断表现出异常的线程

如:我遇到一起死锁的例子,现象是websocket通信突然断开,无法处理任何消息。
于是把websocker的数据处理线程的调用栈用gdb打印出来,如下:

Thread 24 (Thread 0x7f37a37fe700 (LWP 20827)):
#0  __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1  0x00007f37f41dbe42 in __GI___pthread_mutex_lock (mutex=0xde65a8) at ../nptl/pthread_mutex_lock.c:115
#2  0x00007f37f7b2e43b in __gthread_mutex_lock (__mutex=0xde65a8) at /usr/local/include/c++/7.4.0/x86_64-pc-linux-gnu/bits/gthr-default.h:748
#3  0x00007f37f7b2e48b in __gthread_recursive_mutex_lock (__mutex=0xde65a8) at /usr/local/include/c++/7.4.0/x86_64-pc-linux-gnu/bits/gthr-default.h:810
#4  0x00007f37f7b32bc8 in std::recursive_mutex::lock (this=0xde65a8) at /usr/local/include/c++/7.4.0/mutex:107
#5  0x00007f37f7b32dfa in std::lock_guard<std::recursive_mutex>::lock_guard (this=0x7f37a37fd010, __m=...) at /usr/local/include/c++/7.4.0/bits/std_mutex.h:162
#6  0x00007f37f7b31aad in RobotStateManage::isContainState (this=0xde6590, stateId=emStateId::BcsAbnormalStateId)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/cphu/src/robotStateManage.cpp:302
#7  0x00007f37f7ad6eda in CentreManage::isContainState (this=0xde6570, stateId=emStateId::BcsAbnormalStateId)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/cphu/src/centremanage.cpp:899
#8  0x00007f37f718056f in robotControl::on_message (this=0x10c4a20, sessionId=2, msgJson=...)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/componentLib/websocketServer/src/robotControl.cpp:142
#9  0x00007f37f720d00e in std::__invoke_impl<void, void (robotControl::*&)(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >), std::shared_ptr<robotControl>&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__invoke_memfun_deref, void (robotControl::*&)(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >), std::shared_ptr<robotControl>&, int&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) (__f=
    @0x10c4b50: (void (robotControl::*)(robotControl * const, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)) 0x7f37f71800d6 <robotControl::on_message(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)>, __t=..., 
    __args#0=<unknown type in ../lib/libwebsocketServer.so, CU 0x744a90, DIE 0x80cbc7>, 
    __args#1=<unknown type in ../lib/libwebsocketServer.so, CU 0x744a90, DIE 0x80cbd6>) at /usr/local/include/c++/7.4.0/bits/invoke.h:73
#10 0x00007f37f720c7a1 in std::__invoke<void (robotControl::*&)(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >), std::shared_ptr<robotControl>&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(void (robotControl::*&)(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >), std::shared_ptr<robotControl>&, int&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) (__fn=
    @0x10c4b50: (void (robotControl::*)(robotControl * const, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)) 0x7f37f71800d6 <robotControl::on_message(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)>, __args#0=..., 
    __args#1=<unknown type in ../lib/libwebsocketServer.so, CU 0x744a90, DIE 0x813a32>, 
    __args#2=<unknown type in ../lib/libwebsocketServer.so, CU 0x744a90, DIE 0x813a41>) at /usr/local/include/c++/7.4.0/bits/invoke.h:95
#11 0x00007f37f720c0f4 in std::_Bind<void (robotControl::*(std::shared_ptr<robotControl>, std::_Placeholder<1>, std::_Placeholder<2>))(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)>::__call<void, int&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, 0ul, 1ul, 2ul>(std::tuple<int&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&>&&, std::_Index_tuple<0ul, 1ul, 2ul>) (this=0x10c4b50, 
    __args=<unknown type in ../lib/libwebsocketServer.so, CU 0x744a90, DIE 0x819a96>) at /usr/local/include/c++/7.4.0/functional:467
#12 0x00007f37f720bab0 in std::_Bind<void (robotControl::*(std::shared_ptr<robotControl>, std::_Placeholder<1>, std::_Placeholder<2>))(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)>::operator()<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void>(int&&, std::__---Type <return> to continue, or q <return> to quit---
cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) (this=0x10c4b50, 
    __args#0=<unknown type in ../lib/libwebsocketServer.so, CU 0x744a90, DIE 0x8208e8>, 
    __args#1=<unknown type in ../lib/libwebsocketServer.so, CU 0x744a90, DIE 0x8208f8>) at /usr/local/include/c++/7.4.0/functional:551
#13 0x00007f37f720b107 in std::_Function_handler<void (int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >), std::_Bind<void (robotControl::*(std::shared_ptr<robotControl>, std::_Placeholder<1>, std::_Placeholder<2>))(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)> >::_M_invoke(std::_Any_data const&, int&&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) (__functor=..., 
    __args#0=<unknown type in ../lib/libwebsocketServer.so, CU 0x744a90, DIE 0x827534>, 
    __args#1=<unknown type in ../lib/libwebsocketServer.so, CU 0x744a90, DIE 0x827543>) at /usr/local/include/c++/7.4.0/bits/std_function.h:316
#14 0x00007f37f70dd294 in std::function<void (int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)>::operator()(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) const (this=0x10c4160, __args#0=2, __args#1=...) at /usr/local/include/c++/7.4.0/bits/std_function.h:706
#15 0x00007f37f70b38c5 in websocketSerImpl::handleMsg (this=0x10c3c30)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/componentLib/websocketServer/src/websocketSerImpl.cpp:258
#16 0x00007f37f70e806c in std::__invoke_impl<void, void (websocketSerImpl::*)(), websocketSerImpl*>(std::__invoke_memfun_deref, void (websocketSerImpl::*&&)(), websocketSerImpl*&&) (__f=<unknown type in ../lib/libwebsocketServer.so, CU 0x0, DIE 0x17cc2f>, __t=<unknown type in ../lib/libwebsocketServer.so, CU 0x0, DIE 0x17cc3d>)
    at /usr/local/include/c++/7.4.0/bits/invoke.h:73
#17 0x00007f37f70dcc0c in std::__invoke<void (websocketSerImpl::*)(), websocketSerImpl*>(void (websocketSerImpl::*&&)(), websocketSerImpl*&&) (
    __fn=<unknown type in ../lib/libwebsocketServer.so, CU 0x0, DIE 0x18c24a>, __args#0=<unknown type in ../lib/libwebsocketServer.so, CU 0x0, DIE 0x18c265>)
    at /usr/local/include/c++/7.4.0/bits/invoke.h:95
#18 0x00007f37f716572b in std::thread::_Invoker<std::tuple<void (websocketSerImpl::*)(), websocketSerImpl*> >::_M_invoke<0ul, 1ul> (this=0x10c9f58)
    at /usr/local/include/c++/7.4.0/thread:234
#19 0x00007f37f7164289 in std::thread::_Invoker<std::tuple<void (websocketSerImpl::*)(), websocketSerImpl*> >::operator() (this=0x10c9f58)
    at /usr/local/include/c++/7.4.0/thread:243
#20 0x00007f37f71613c0 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (websocketSerImpl::*)(), websocketSerImpl*> > >::_M_run (this=0x10c9f50)
    at /usr/local/include/c++/7.4.0/thread:186
#21 0x00007f37e97bdc90 in execute_native_thread_routine () at ../../../../../libstdc++-v3/src/c++11/thread.cc:80
#22 0x00007f37f41d96ba in start_thread (arg=0x7f37a37fe700) at pthread_create.c:333
#23 0x00007f37e8f0e4dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

从上面的调用栈中可以初步判断,出现死锁的类是:RobotStateManage

二、gdb打印出所有线程调用栈,筛选出包含 RobotStateManage的调用栈如下:

1、

// A code block
Thread 10 (Thread 0x7f37bf59a700 (LWP 20301)):
#0  __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1  0x00007f37f41dbe42 in __GI___pthread_mutex_lock (mutex=0xde65a8) at ../nptl/pthread_mutex_lock.c:115
#2  0x00007f37f7b2e43b in __gthread_mutex_lock (__mutex=0xde65a8) at /usr/local/include/c++/7.4.0/x86_64-pc-linux-gnu/bits/gthr-default.h:748
#3  0x00007f37f7b2e48b in __gthread_recursive_mutex_lock (__mutex=0xde65a8) at /usr/local/include/c++/7.4.0/x86_64-pc-linux-gnu/bits/gthr-default.h:810
#4  0x00007f37f7b32bc8 in std::recursive_mutex::lock (this=0xde65a8) at /usr/local/include/c++/7.4.0/mutex:107
#5  0x00007f37f7b32dfa in std::lock_guard<std::recursive_mutex>::lock_guard (this=0x7f37bf599298, __m=...) at /usr/local/include/c++/7.4.0/bits/std_mutex.h:162
#6  0x00007f37f7b312ce in RobotStateManage::getRobotStateById (this=0xde6590, stateId=emStateId::BreakdownStateId)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/cphu/src/robotStateManage.cpp:267
#7  0x00007f37f7b2ff99 in RobotStateManage::eraseState (this=0xde6590, stateId=emStateId::BreakdownStateId, pStateArg=0x0)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/cphu/src/robotStateManage.cpp:149
#8  0x00007f37f7ad6e7a in CentreManage::eraseState (this=0xde6570, stateId=emStateId::BreakdownStateId, pStateArg=0x0)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/cphu/src/centremanage.cpp:884
#9  0x00007f37f508a5e2 in HardwareSpace::HardwareStatus::<lambda()>::operator()(void) const (__closure=0x7f37bf599908)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/componentLib/navicat/src/hardwareStatus.cpp:52
#10 0x00007f37f508a676 in HardwareSpace::HardwareStatus::deviceStatusHandleThreadEntry (
    this=0x7f37f531fea0 <HardwareSpace::HardwareStatus::getInstance()::hardwareStatus>)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/componentLib/navicat/src/hardwareStatus.cpp:57
#11 0x00007f37f508efc8 in std::__invoke_impl<void, void (HardwareSpace::HardwareStatus::*)(), HardwareSpace::HardwareStatus*>(std::__invoke_memfun_deref, void (HardwareSpace::HardwareStatus::*&&)(), HardwareSpace::HardwareStatus*&&) (__f=<unknown type in ../lib/libnavicat.so, CU 0x31a005, DIE 0x3ed9c6>, 
    __t=<unknown type in ../lib/libnavicat.so, CU 0x31a005, DIE 0x3ed9d4>) at /usr/local/include/c++/7.4.0/bits/invoke.h:73
#12 0x00007f37f508e4aa in std::__invoke<void (HardwareSpace::HardwareStatus::*)(), HardwareSpace::HardwareStatus*>(void (HardwareSpace::HardwareStatus::*&&)(), HardwareSpace::HardwareStatus*&&) (__fn=<unknown type in ../lib/libnavicat.so, CU 0x31a005, DIE 0x3f8f86>, 
    __args#0=<unknown type in ../lib/libnavicat.so, CU 0x31a005, DIE 0x3f8fa1>) at /usr/local/include/c++/7.4.0/bits/invoke.h:95
#13 0x00007f37f5091bf3 in std::thread::_Invoker<std::tuple<void (HardwareSpace::HardwareStatus::*)(), HardwareSpace::HardwareStatus*> >::_M_invoke<0ul, 1ul> (
    this=0x10c47d8) at /usr/local/include/c++/7.4.0/thread:234
#14 0x00007f37f5091ba9 in std::thread::_Invoker<std::tuple<void (HardwareSpace::HardwareStatus::*)(), HardwareSpace::HardwareStatus*> >::operator() (this=0x10c47d8)
    at /usr/local/include/c++/7.4.0/thread:243
#15 0x00007f37f5091b88 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (HardwareSpace::HardwareStatus::*)(), HardwareSpace::HardwareStatus*> > >::_M_run (this=0x10c47d0) at /usr/local/include/c++/7.4.0/thread:186
#16 0x00007f37e97bdc90 in execute_native_thread_routine () at ../../../../../libstdc++-v3/src/c++11/thread.cc:80
#17 0x00007f37f41d96ba in start_thread (arg=0x7f37bf59a700) at pthread_create.c:333
#18 0x00007f37e8f0e4dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

2、


Thread 3 (Thread 0x7f37c2da1700 (LWP 20294)):
#0  __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1  0x00007f37f41dbe42 in __GI___pthread_mutex_lock (mutex=0xde65a8) at ../nptl/pthread_mutex_lock.c:115
#2  0x00007f37f7b2e43b in __gthread_mutex_lock (__mutex=0xde65a8) at /usr/local/include/c++/7.4.0/x86_64-pc-linux-gnu/bits/gthr-default.h:748
#3  0x00007f37f7b2e48b in __gthread_recursive_mutex_lock (__mutex=0xde65a8) at /usr/local/include/c++/7.4.0/x86_64-pc-linux-gnu/bits/gthr-default.h:810
#4  0x00007f37f7b32bc8 in std::recursive_mutex::lock (this=0xde65a8) at /usr/local/include/c++/7.4.0/mutex:107
#5  0x00007f37f7b32dfa in std::lock_guard<std::recursive_mutex>::lock_guard (this=0x7f37c2da0838, __m=...) at /usr/local/include/c++/7.4.0/bits/std_mutex.h:162
#6  0x00007f37f7b2f0cd in RobotStateManage::getCurrentStateList (this=0xde6590, stateList=...)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/cphu/src/robotStateManage.cpp:47
#7  0x00007f37f7b2f24d in RobotStateManage::<lambda()>::operator()(void) const (__closure=0x109ed68)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/cphu/src/robotStateManage.cpp:64
#8  0x00007f37f7b31d47 in std::__invoke_impl<void, RobotStateManage::initStateManage()::<lambda()> >(std::__invoke_other, <unknown type in ../lib/libcentralPM.so, CU 0x1f054a, DIE 0x292de7>) (__f=<unknown type in ../lib/libcentralPM.so, CU 0x1f054a, DIE 0x292de7>) at /usr/local/include/c++/7.4.0/bits/invoke.h:60
#9  0x00007f37f7b31b8b in std::__invoke<RobotStateManage::initStateManage()::<lambda()> >(<unknown type in ../lib/libcentralPM.so, CU 0x1f054a, DIE 0x29e154>) (
    __fn=<unknown type in ../lib/libcentralPM.so, CU 0x1f054a, DIE 0x29e154>) at /usr/local/include/c++/7.4.0/bits/invoke.h:95
#10 0x00007f37f7b32b26 in std::thread::_Invoker<std::tuple<RobotStateManage::initStateManage()::<lambda()> > >::_M_invoke<0>(std::_Index_tuple<0>) (this=0x109ed68)
    at /usr/local/include/c++/7.4.0/thread:234
#11 0x00007f37f7b32af7 in std::thread::_Invoker<std::tuple<RobotStateManage::initStateManage()::<lambda()> > >::operator()(void) (this=0x109ed68)
    at /usr/local/include/c++/7.4.0/thread:243
#12 0x00007f37f7b32ad6 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<RobotStateManage::initStateManage()::<lambda()> > > >::_M_run(void) (this=0x109ed60)
    at /usr/local/include/c++/7.4.0/thread:186
#13 0x00007f37e97bdc90 in execute_native_thread_routine () at ../../../../../libstdc++-v3/src/c++11/thread.cc:80
#14 0x00007f37f41d96ba in start_thread (arg=0x7f37c2da1700) at pthread_create.c:333
#15 0x00007f37e8f0e4dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

3、


Thread 21 (Thread 0x7f37b57fa700 (LWP 20319)):
---Type <return> to continue, or q <return> to quit---
#0  __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1  0x00007f37f41dbdbd in __GI___pthread_mutex_lock (mutex=0x7f37f63b6320 <CMqttClient::m_lock>) at ../nptl/pthread_mutex_lock.c:80
#2  0x00000000004b475d in __gthread_mutex_lock (__mutex=0x7f37f63b6320 <CMqttClient::m_lock>) at /usr/local/include/c++/7.4.0/x86_64-pc-linux-gnu/bits/gthr-default.h:748
#3  0x00000000004b78fc in std::mutex::lock (this=0x7f37f63b6320 <CMqttClient::m_lock>) at /usr/local/include/c++/7.4.0/bits/std_mutex.h:103
#4  0x00000000004c4362 in std::lock_guard<std::mutex>::lock_guard (this=0x7f37b57f72b8, __m=...) at /usr/local/include/c++/7.4.0/bits/std_mutex.h:162
#5  0x00007f37f614a16a in CMqttClient::mqtt_Cli_Publish (this=0x10a25b0, msg=..., qos=2)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/componentLib/mqttClient/framework/src/CMqttClient.cpp:191
#6  0x00007f37f612ab65 in MqttComMsgHandler::publishMsg (this=0x10a1e30, originalData=..., cmd=2607, qos=2)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/componentLib/mqttClient/framework/src/MqttComMsgHandler.cpp:126
#7  0x00007f37f6154714 in MsgToCloud::deviceStatusUpdate (this=0x10c3b10, status=3)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/componentLib/mqttClient/business/src/MsgToCloud.cpp:87
#8  0x00007f37f60f51a7 in MqttCb::deviceStatusUpdate (this=0x7f37f63b5a20 <MqttCb::getInstance()::mqttCb>, status=3)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/componentLib/mqttClient/framework/src/MqttCb.cpp:87
#9  0x00007f37f47e9fea in GeneralAbility::deviceStatusReport (this=0x7f37f4a6a1c0 <FunctionHandlerBase::getInstance()::generalAbility>, status=3 '\003', 
    platform=emPlatform::All) at /data/weiy/RV_POS/Cpp/robotself_new/src/componentLib/generalAbility/GeneralAbility.cpp:2275
#10 0x00007f37f7b2092e in AwaitOrderState::behavior (this=0x10c6820) at /data/weiy/RV_POS/Cpp/robotself_new/src/cphu/src/robotState.cpp:14
#11 0x00007f37f7b2fcfd in RobotStateManage::stateBehave (this=0xde6590) at /data/weiy/RV_POS/Cpp/robotself_new/src/cphu/src/robotStateManage.cpp:141
#12 0x00007f37f7b2f85e in RobotStateManage::changeState (this=0xde6590, pState=0x10c6820) at /data/weiy/RV_POS/Cpp/robotself_new/src/cphu/src/robotStateManage.cpp:123
#13 0x00007f37f7b30881 in RobotStateManage::eraseState (this=0xde6590, stateId=emStateId::ScanMapStateId, pStateArg=0x7f37b57f8390)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/cphu/src/robotStateManage.cpp:184
#14 0x00007f37f7ad6e7a in CentreManage::eraseState (this=0xde6570, stateId=emStateId::ScanMapStateId, pStateArg=0x7f37b57f8390)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/cphu/src/centremanage.cpp:884
#15 0x00007f37f503b5e3 in NavicatImpl::<lambda()>::operator()(void) const (__closure=0x10cdf48)
    at /data/weiy/RV_POS/Cpp/robotself_new/src/componentLib/navicat/src/navicatImpl.cpp:365
#16 0x00007f37f5049ad7 in std::__invoke_impl<void, NavicatImpl::startDataRecvThread()::<lambda()> >(std::__invoke_other, <unknown type in ../lib/libnavicat.so, CU 0xe8331, DIE 0x231832>) (__f=<unknown type in ../lib/libnavicat.so, CU 0xe8331, DIE 0x231832>) at /usr/local/include/c++/7.4.0/bits/invoke.h:60
#17 0x00007f37f504914b in std::__invoke<NavicatImpl::startDataRecvThread()::<lambda()> >(<unknown type in ../lib/libnavicat.so, CU 0xe8331, DIE 0x2420aa>) (
    __fn=<unknown type in ../lib/libnavicat.so, CU 0xe8331, DIE 0x2420aa>) at /usr/local/include/c++/7.4.0/bits/invoke.h:95
#18 0x00007f37f504c24a in std::thread::_Invoker<std::tuple<NavicatImpl::startDataRecvThread()::<lambda()> > >::_M_invoke<0>(std::_Index_tuple<0>) (this=0x10cdf48)
    at /usr/local/include/c++/7.4.0/thread:234
#19 0x00007f37f504c19f in std::thread::_Invoker<std::tuple<NavicatImpl::startDataRecvThread()::<lambda()> > >::operator()(void) (this=0x10cdf48)
    at /usr/local/include/c++/7.4.0/thread:243
#20 0x00007f37f504c116 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<NavicatImpl::startDataRecvThread()::<lambda()> > > >::_M_run(void) (this=0x10cdf40)
    at /usr/local/include/c++/7.4.0/thread:186
#21 0x00007f37e97bdc90 in execute_native_thread_routine () at ../../../../../libstdc++-v3/src/c++11/thread.cc:80
#22 0x00007f37f41d96ba in start_thread (arg=0x7f37b57fa700) at pthread_create.c:333
#23 0x00007f37e8f0e4dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

根据上面的调用栈,对照代码分析,发现是第三个调用栈出现了问题,
CMqttClient::mqtt_Cli_Publish 函数发生了死锁。
看代码很容易发现,真正出问题的类是:CMqttClient
而表象出来的现象却是:RobotStateManage 有问题。
这也说明,死锁罪魁祸首并不一定是表面上看到的,需要配合多个线程调用栈综合分析。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值