vendredi 11 août 2017

map::operator[] crashing on insert

I have a simple map<int, int> but every once in a while it keeps crashing on inserting an element in it. Debugging and inspecting the frames, I see that both the key and value are valid. For example in the following call stack below, I see the key is 8 and value is 15 (In frame 5: type=@0x7fc0135fcfd0: 8, px=@0x7fc0135fcdcc: 15).

Please can someone help decode what exactly is going wrong in the last three frames of the call stack below? What is the significance of "__k=__k@entry=<unknown type" in frame 4. Or could it be some kind of memory corruption due to simultaneous access from another thread?

#0  std::local_Rb_tree_rotate_right (__x=__x@entry=0x7fbf645f7e10, __root=@0x7fc024c952e8: 0x7fbf645f7e70) at ../../../../../gcc-4.9.1/libstdc++-v3/src/c++98/tree.cc:169

#1  0x00007fc089f2bc74 in std::_Rb_tree_insert_and_rebalance (__insert_left=<optimized out>, __x=0x7fbf64783db0, __p=<optimized out>, __header=...)
    at ../../../../../gcc-4.9.1/libstdc++-v3/src/c++98/tree.cc:256

#2  0x00007fc08846d21d in _M_insert_node (__z=0x7fbf64783db0, __p=<optimized out>, __x=<optimized out>, this=0x7fc024c952d8)
    at /home/jenkins/debrepo/ext/linux/x86-64/release/opt/gcc-4.9.1/include/c++/4.9.1/bits/stl_tree.h:1696

#3  _M_emplace_hint_unique<const std::piecewise_construct_t&, std::tuple<int&&>, std::tuple<> > (__pos=..., this=0x7fc024c952d8)
    at /home/jenkins/debrepo/ext/linux/x86-64/release/opt/gcc-4.9.1/include/c++/4.9.1/bits/stl_tree.h:1797

#4  std::map<int, int, std::less<int>, std::allocator<std::pair<int const, int> > >::operator[](int&&) (this=0x7fc024c952d8,
    __k=__k@entry=<unknown type in /opt/project/ps/lib/libmarket_lh.so, CU 0x40f022, DIE 0x5635c6>)
    at /home/jenkins/debrepo/ext/linux/x86-64/release/opt/gcc-4.9.1/include/c++/4.9.1/bits/stl_map.h:519

#5  0x00007fc08845e70d in PT::AddPrice (this=this@entry=0x7fc024c94990, update=update@entry=0x7fbf64004250, type=@0x7fc0135fcfd0: 8, px=@0x7fc0135fcdcc: 15,
    qty=@0x7fc0135fd030: 2147483647, position=position@entry=2147483647, numOrders=2147483647, precision=0, decimals=0)

Aucun commentaire:

Enregistrer un commentaire