返回信息流这是出错地方的代码,在erase那句报错。我输出了m_mHarqRank2SINR中的数据,发现也确实包含 关键字(m_iHARQID, _iRankID),关键字对应的value也有,不明白为什么会不能删除。
map<pair<int, int>, vector<double> >::iterator it = m_mHarqRank2SINR.find(make_pair(m_iHARQID, _iRankID));
if (it != m_mHarqRank2SINR.end()) {
m_mHarqRank2SINR.erase(it);
} else {
cout<<"HARQRxStateMS can not erase data!"<<endl;
assert(false);
}
下面是查问题(free(): invalid next size)的时候遇到类似的错误,一个人的回答。
It means that you have a memory error. You may be trying to free a pointer that wasn't allocated by malloc (or delete an object that wasn't created by new) or you may be trying to free/delete such an object more than once. You may be overflowing a buffer or otherwise writing to memory to which you shouldn't be writing, causing heap corruption.
求各位大神指点,跪谢[ema23]
后面是报错提示的一大堆看不懂信息
*** glibc detected *** /home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1: free(): invalid next size (fast): 0x000000011abe5dc0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7da26)[0x7ffff66f9a26]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x426ad4]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x425966]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x424b83]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x424478]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x433192]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x4331b0]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x43094a]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x485d92]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x4857d8]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x48556b]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x484f68]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x44e38d]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x4472ce]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x4f8e83]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x4f8e1d]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x52567b]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x5923fb]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x590184]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x5617ad]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7ffff669d7ed]
/home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1[0x410199]
======= Memory map: ========
00400000-006ab000 r-xp 00000000 08:03 22809563 /home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1
008aa000-008ab000 r--p 002aa000 08:03 22809563 /home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1
008ab000-008ac000 rw-p 002ab000 08:03 22809563 /home/wangfei/桌面/Add MU/xiugai8.9.3(test)/new_1/dist/Debug/GNU-Linux-x86/new_1
008ac000-11b14d000 rw-p 00000000 00:00 0 [heap]
7ffff4625000-7ffff4d08000 r--p 00000000 08:03 34871590 /usr/lib/locale/locale-archive
7ffff4d08000-7ffff4d3d000 r-xp 00000000 08:03 34872719 /usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0
7ffff4d3d000-7ffff4f3c000 ---p 00035000 08:03 34872719 /usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0
7ffff4f3c000-7ffff4f3d000 r--p 00034000 08:03 34872719 /usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0
7ffff4f3d000-7ffff4f3e000 rw-p 00035000 08:03 34872719 /usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0
7ffff4f3e000-7ffff5052000 r-xp 00000000 08:03 34867497 /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0
7ffff5052000-7ffff5252000 ---p 00114000 08:03 34867497 /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0
7ffff5252000-7ffff5253000 r--p 00114000 08:03 34867497 /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0
7ffff5253000-7ffff5255000 rw-p 00115000 08:03 34867497 /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0
7ffff5255000-7ffff52ee000 r-xp 00000000 08:03 36204007 /usr/lib/libblas/libblas.so.3gf.0
7ffff52ee000-7ffff54ed000 ---p 00099000 08:03 36204007 /usr/lib/libblas/libblas.so.3gf.0
7ffff54ed000-7ffff54ee000 r--p 00098000 08:03 36204007 /usr/lib/libblas/libblas.so.3gf.0
7ffff54ee000-7ffff54ef000 rw-p 00099000 08:03 36204007 /usr/lib/libblas/libblas.so.3gf.0
7ffff54ef000-7ffff5dd4000 r-xp 00000000 08:03 36204029 /usr/lib/lapack/liblapack.so.3gf.0
7ffff5dd4000-7ffff5fd3000 ---p 008e5000 08:03 36204029 /usr/lib/lapack/liblapack.so.3gf.0
7ffff5fd3000-7ffff5fd4000 r--p 008e4000 08:03 36204029 /usr/lib/lapack/liblapack.so.3gf.0
7ffff5fd4000-7ffff5fd8000 rw-p 008e5000 08:03 36204029 /usr/lib/lapack/liblapack.so.3gf.0
7ffff5fd8000-7ffff60e5000 rw-p 00000000 00:00 0
7ffff60e5000-7ffff6253000 r-xp 00000000 08:03 34867504 /usr/lib/libfftw3.so.3.3.0
7ffff6253000-7ffff6452000 ---p 0016e000 08:03 34867504 /usr/lib/libfftw3.so.3.3.0
7ffff6452000-7ffff645e000 r--p 0016d000 08:03 34867504 /usr/lib/libfftw3.so.3.3.0
7ffff645e000-7ffff645f000 rw-p 00179000 08:03 34867504 /usr/lib/libfftw3.so.3.3.0
7ffff645f000-7ffff6477000 r-xp 00000000 08:03 49021054 /lib/x86_64-linux-gnu/libpthread-2.15.so
7ffff6477000-7ffff6676000 ---p 00018000 08:03 49021054 /lib/x86_64-linux-gnu/libpthread-2.15.so
7ffff6676000-7ffff6677000 r--p 00017000 08:03 49021054 /lib/x86_64-linux-gnu/libpthread-2.15.so
7ffff6677000-7ffff6678000 rw-p 00018000 08:03 49021054 /lib/x86_64-linux-gnu/libpthread-2.15.so
7ffff6678000-7ffff667c000 rw-p 00000000 00:00 0
7ffff667c000-7ffff6830000 r-xp 00000000 08:03 49021051 /lib/x86_64-linux-gnu/libc-2.15.so
7ffff6830000-7ffff6a2f000 ---p 001b4000 08:03 49021051 /lib/x86_64-linux-gnu/libc-2.15.so
7ffff6a2f000-7ffff6a33000 r--p 001b3000 08:03 49021051 /lib/x86_64-linux-gnu/libc-2.15.so
7ffff6a33000-7ffff6a35000 rw-p 001b7000 08:03 49021051 /lib/x86_64-linux-gnu/libc-2.15.so
7ffff6a35000-7ffff6a3a000 rw-p 00000000 00:00 0
7ffff6a3a000-7ffff6a4f000 r-xp 00000000 08:03 49024684 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff6a4f000-7ffff6c4e000 ---p 00015000 08:03 49024684 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff6c4e000-7ffff6c4f000 r--p 00014000 08:03 49024684 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff6c4f000-7ffff6c50000 rw-p 00015000 08:03 49024684 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff6c50000-7ffff6d4b000 r-xp 00000000 08:03 49024873 /lib/x86_64-linux-gnu/libm-2.15.so
7ffff6d4b000-7ffff6f4a000 ---p 000fb000 08:03 49024873 /lib/x86_64-linux-gnu/libm-2.15.so
7ffff6f4a000-7ffff6f4b000 r--p 000fa000 08:03 49024873 /lib/x86_64-linux-gnu/libm-2.15.so
7ffff6f4b000-7ffff6f4c000 rw-p 000fb000 08:03 49024873 /lib/x86_64-linux-gnu/libm-2.15.so
7ffff6f4c000-7ffff702e000 r-xp 00000000 08:03 34872775 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7ffff702e000-7ffff722d000 ---p 000e2000 08:03 34872775 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7ffff722d000-7ffff7235000 r--p 000e1000 08:03 34872775 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7ffff7235000-7ffff7237000 rw-p 000e9000 08:03 34872775 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7ffff7237000-7ffff724c000 rw-p 00000000 00:00 0
7ffff724c000-7ffff7583000 r-xp 00000000 08:03 35133405 /usr/local/lib/libitpp.so.6.0.7
7ffff7583000-7ffff7782000 ---p 00337000 08:03 35133405 /usr/local/lib/libitpp.so.6.0.7
7ffff7782000-7ffff7788000 r--p 00336000 08:03 35133405 /usr/local/lib/libitpp.so.6.0.7
7ffff7788000-7ffff778f000 rw-p 0033c000 08:03 35133405 /usr/local/lib/libitpp.so.6.0.7
7ffff778f000-7ffff779f000 rw-p 00000000 00:00 0
7ffff779f000-7ffff77bc000 r-xp 00000000 08:03 34871828 /usr/lib/libboost_filesystem.so.1.46.1
7ffff77bc000-7ffff79bb000 ---p 0001d000 08:03 34871828 /usr/lib/libboost_filesystem.so.1.46.1
7ffff79bb000-7ffff79bc000 r--p 0001c000 08:03 34871828 /usr/lib/libboost_filesystem.so.1.46.1
7ffff79bc000-7ffff79bd000 rw-p 0001d000 08:03 34871828 /usr/lib/libboost_filesystem.so.1.46.1
7ffff79bd000-7ffff79d4000 r-xp 00000000 08:03 34873255 /usr/lib/libboost_thread.so.1.46.1
7ffff79d4000-7ffff7bd3000 ---p 00017000 08:03 34873255 /usr/lib/libboost_thread.so.1.46.1
7ffff7bd3000-7ffff7bd5000 r--p 00016000 08:03 34873255 /usr/lib/libboost_thread.so.1.46.1
7ffff7bd5000-7ffff7bd6000 rw-p 00018000 08:03 34873255 /usr/lib/libboost_thread.so.1.46.1
7ffff7bd6000-7ffff7bd9000 r-xp 00000000 08:03 34871827 /usr/lib/libboost_system.so.1.46.1
7ffff7bd9000-7ffff7dd8000 ---p 00003000 08:03 34871827 /usr/lib/libboost_system.so.1.46.1
7ffff7dd8000-7ffff7dd9000 r--p 00002000 08:03 34871827 /usr/lib/libboost_system.so.1.46.1
7ffff7dd9000-7ffff7dda000 rw-p 00003000 08:03 34871827 /usr/lib/libboost_system.so.1.46.1
7ffff7dda000-7ffff7dfc000 r-xp 00000000 08:03 49024601 /lib/x86_64-linux-gnu/ld-2.15.so
7ffff7fdb000-7ffff7fe4000 rw-p 00000000 00:00 0
7ffff7fef000-7ffff7ff1000 rw-p 00000000 00:00 0
7ffff7ff1000-7ffff7ff8000 r--s 00000000 08:03 35129056 /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
7ffff7ff8000-7ffff7ffa000 rw-p 00000000 00:00 0
7ffff7ffa000-7ffff7ffc000 r-xp 00000000 00:00 0 [vdso]
7ffff7ffc000-7ffff7ffd000 r--p 00022000 08:03 49024601 /lib/x86_64-linux-gnu/ld-2.15.so
7ffff7ffd000-7ffff7fff000 rw-p 00023000 08:03 49024601 /lib/x86_64-linux-gnu/ld-2.15.so
7ffffffde000-7ffffffff000 rw-p 00000000 00:00 0 [stack]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
这是一条镜像帖。来源:北邮人论坛 / cpp / #93694同步于 2016/10/13
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖
Ubuntu下(不过我完全不懂linux...),NetBeans,map查找元素后
ray19950624
2016/10/13镜像同步4 回复
订阅后,新回复会通过你的通知中心匿名送达。
4 条回复
单线程和多线程跑都会出错,不过具体单线程和多线程怎么实现的我就不太了解了。错误的好尴尬,完全不理解。大神有思路么?
【 在 xiaobing307 的大作中提到: 】
: 单线程程序?