kkvcb 2016-09-07 04:23 采纳率: 66.7%
浏览 3929

c++ map插入数据,导致段错误

出错时堆栈信息:
#0 0x001a03f0 in std::string::compare () from lib/libstdc++.so.6
#1 0x003c4b56 in std::operator< , std::allocator > (__lhs=@0x91a4228, __rhs=@0x96b1afc4)
at /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:2213
#2 0x003c4b74 in std::lessstd::string::operator() (this=0x91a4218, __x=@0x91a4228, __y=@0x96b1afc4)
at /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_function.h:227
#3 0x017d4e25 in std::_Rb_tree, std::_Select1st >, std::lessstd::string, std::allocator > >::lower_bound (this=0x91a4218, __k=@0x96b1afc4)
at /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_tree.h:1371
#4 0x017d4ea3 in std::map, std::allocator > >::lower_bound (this=0x91a4218, __x=@0x96b1afc4) at /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_map.h:576
#5 0x017dbbf2 in std::map, std::allocator > >::operator at /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_map.h:345

出错的语句:
pEntity->m_mapID[log.strID]=log;
我对stl不太了解,请问这个错误可能是什么什么原因?

  • 写回答

6条回答 默认 最新

  • hijack00 2016-09-07 04:33
    关注

    感觉你把代码贴出来更容易找到错误。感觉使用STL时编译器给出的出错信息好多并没什么用

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog