崩溃发生了:std :: local_Rb_tree_increment,std :: local_Rb_tree_increment

时间:2018-06-07 05:48:38

标签: c++ stdmap

我试图找出问题,但我无法修复错误。根据崩溃行号,地图操作存在问题。

Callstack如下所述:

#0 0xf6e41720 in std::local_Rb_tree_increment (__x=0xe) at ../../../../../libstdc++-v3/src/c++98/tree.cc:65
No locals.
#1  std::_Rb_tree_increment (__x=0xf7668298) at ../../../../../libstdc++-v3/src/c++98/tree.cc:91
No locals.
#2  0x006c0738 in std::_Rb_tree_iterator<std::pair<int const, EventListner*> >::operator++ (this=<synthetic pointer>)
    at /home/dpi/Tizen4.0/tools/arm-linux-gnueabi-gcc-6.2/arm-tizen-linux-gnueabi/include/c++/6.2.1/bits/stl_tree.h:209
No locals.
#3  NetworkProxy::FindProxyReqID (eventListener=0x2133c20, this=0x7b9c0c <NetworkProxy::GetInstance()::instance>)
    at src/network/NetworkProxy.cpp:272
        httpNetworkProxyReqID = <optimized out>
        iter = <optimized out>
#4  NetworkProxy::UnRegisterEventListener (this=this@entry=0x7b9c0c <NetworkProxy::GetInstance()::instance>, 
    eventListener=eventListener@entry=0x2133c20) at src/network/NetworkProxy.cpp:65
        reqID = -149150168
        __func__ = "UnRegisterEventListener"

以下是代码部分:

void NetworkProxy::UnRegisterEventListener(EventListner* eventListener)
{
    if(mEventListenerMap.size() > 0){
        ProxyReqID reqID = FindProxyReqID(eventListener);
        if(mEventListenerMap.erase(reqID) < 1){
            DEBUG_ERR("mEventListenerMap.erase failed(%d). there is no request ID", reqID);
        }
    }
}

ProxyReqID NetworkProxy::FindProxyReqID(EventListner* eventListener)
{
    ProxyReqID reqID = -1;
    std::map<ProxyReqID, EventListner*>::iterator iter;

    for(iter = mEventListenerMap.begin(); iter != mEventListenerMap.end(); ++iter) {// this is the line - 272 where the crash happened.
        EventListner* findEventListener = iter->second;
        if(findEventListener == eventListener){
            reqID = iter->first;
            break;
        }
    }
    return reqID;
}

0 个答案:

没有答案