如何跟踪缓冲区溢出检测到-ns终止

时间:2017-10-14 18:11:58

标签: c++ linux ubuntu gcc ns2

我正在为我的ubuntu工作基于ns2的aqua-sim,我收到了缓冲区溢出错误,我无法弄清楚如何跟踪这种错误。 我尝试使用gdb进行调试,但没有运气,因为我不知道如何跟踪错误,有人可以根据以下错误段告诉我应该在哪里查看:

num_nodes is set 10
INITIALIZE THE LIST xListHead
Starting Simulation...
GOD: the old file name istest.data
GOD: the new file name isunderwater.data
*** buffer overflow detected ***: ns terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f57d8e347e5]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7f57d8ed611c]
/lib/x86_64-linux-gnu/libc.so.6(+0x117120)[0x7f57d8ed4120]
/lib/x86_64-linux-gnu/libc.so.6(+0x116689)[0x7f57d8ed3689]
/lib/x86_64-linux-gnu/libc.so.6(_IO_default_xsputn+0x80)[0x7f57d8e386b0]
/lib/x86_64-linux-gnu/libc.so.6(_IO_vfprintf+0xc90)[0x7f57d8e0ae00]
/lib/x86_64-linux-gnu/libc.so.6(__vsprintf_chk+0x84)[0x7f57d8ed3714]
/lib/x86_64-linux-gnu/libc.so.6(__sprintf_chk+0x7d)[0x7f57d8ed366d]
ns[0x57ea03]
ns[0x57eb44]
ns[0x415367]
ns[0x4162e6]
ns[0x416d8c]
ns[0x5b3894]
ns[0x5b85d5]
ns[0x5bdf12]
ns[0x5c0372]
ns[0x5e7de9]
ns[0x5ec6c0]
ns[0x5e7e99]
ns[0x5ec6c0]
ns[0x613615]
ns[0x613803]
ns[0x5b8705]
ns[0x5bdf12]
ns[0x5c0372]
ns[0x5e7de9]
ns[0x5ec6c0]
ns[0x613615]
ns[0x613803]
ns[0x5b85d5]
ns[0x5bdf12]
ns[0x5c0372]
ns[0x5c1c37]
ns[0x603321]
ns[0x606936]
ns[0x405abe]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f57d8ddd830]
ns[0x410f59]
======= Memory map: ========
00400000-00766000 r-xp 00000000 08:06 2491295                                  /home/me/Aqua-Sim/Aqua-Sim-1.0/ns-2.30/ns
00965000-00967000 r--p 00365000 08:06 2491295                            /home/me/Aqua-Sim/Aqua-Sim-1.0/ns-2.30/ns
00967000-009f2000 rw-p 00367000 08:06 2491295                            /home/me/Aqua-Sim/Aqua-Sim-1.0/ns-2.30/ns
009f2000-00a00000 rw-p 00000000 00:00 0 
00c2e000-01085000 rw-p 00000000 00:00 0                                   [heap]
7f57d8ad0000-7f57d8dbd000 r--p 00000000 08:06 2627421                     /usr/lib/locale/locale-archive
7f57d8dbd000-7f57d8f7d000 r-xp 00000000 08:06 1179887                    /lib/x86_64-linux-gnu/libc-2.23.so
7f57d8f7d000-7f57d917d000 ---p 001c0000 08:06 1179887                    /lib/x86_64-linux-gnu/libc-2.23.so
7f57d917d000-7f57d9181000 r--p 001c0000 08:06 1179887                    /lib/x86_64-linux-gnu/libc-2.23.so
7f57d9181000-7f57d9183000 rw-p 001c4000 08:06 1179887                    /lib/x86_64-linux-gnu/libc-2.23.so
7f57d9183000-7f57d9187000 rw-p 00000000 00:00 0 
7f57d9187000-7f57d919d000 r-xp 00000000 08:06 1184430                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f57d919d000-7f57d939c000 ---p 00016000 08:06 1184430                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f57d939c000-7f57d939d000 rw-p 00015000 08:06 1184430                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f57d939d000-7f57d9517000 r-xp 00000000 08:06 2621627                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24
7f57d9517000-7f57d9716000 ---p 0017a000 08:06 2621627                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24
7f57d9716000-7f57d9720000 r--p 00179000 08:06 2621627                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24
7f57d9720000-7f57d9722000 rw-p 00183000 08:06 2621627                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24
7f57d9722000-7f57d9725000 rw-p 00000000 00:00 0 
7f57d9725000-7f57d982d000 r-xp 00000000 08:06 1179880                    /lib/x86_64-linux-gnu/libm-2.23.so
7f57d982d000-7f57d9a2c000 ---p 00108000 08:06 1179880                    /lib/x86_64-linux-gnu/libm-2.23.so
7f57d9a2c000-7f57d9a2d000 r--p 00107000 08:06 1179880                    /lib/x86_64-linux-gnu/libm-2.23.so
7f57d9a2d000-7f57d9a2e000 rw-p 00108000 08:06 1179880                    /lib/x86_64-linux-gnu/libm-2.23.so
7f57d9a2e000-7f57d9a31000 r-xp 00000000 08:06 1179868                    /lib/x86_64-linux-gnu/libdl-2.23.so
7f57d9a31000-7f57d9c30000 ---p 00003000 08:06 1179868                    /lib/x86_64-linux-gnu/libdl-2.23.so
7f57d9c30000-7f57d9c31000 r--p 00002000 08:06 1179868                    /lib/x86_64-linux-gnu/libdl-2.23.so
7f57d9c31000-7f57d9c32000 rw-p 00003000 08:06 1179868                    /lib/x86_64-linux-gnu/libdl-2.23.so
7f57d9c32000-7f57d9c58000 r-xp 00000000 08:06 1179846                    /lib/x86_64-linux-gnu/ld-2.23.so
7f57d9e37000-7f57d9e3d000 rw-p 00000000 00:00 0 
7f57d9e54000-7f57d9e57000 rw-p 00000000 00:00 0 
7f57d9e57000-7f57d9e58000 r--p 00025000 08:06 1179846                    /lib/x86_64-linux-gnu/ld-2.23.so
7f57d9e58000-7f57d9e59000 rw-p 00026000 08:06 1179846                    /lib/x86_64-linux-gnu/ld-2.23.so
7f57d9e59000-7f57d9e5a000 rw-p 00000000 00:00 0 
7ffeddbfa000-7ffeddc1c000 rw-p 00000000 00:00 0                          [stack]
7ffeddc4b000-7ffeddc4d000 r--p 00000000 00:00 0                          [vvar]
7ffeddc4d000-7ffeddc4f000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted (core dumped)

我的gcc是4.9,在ns-2.30和ubuntu 16.04

0 个答案:

没有答案