Skip to content

Problem with stack or memory allocation in NS-2

I’ve installed ns-2.34 and aodv-uu-0.9.6 on Ubuntu. But when I run simulation and type “ns”, I got error message like this :

abdusy@abdusy-desktop:~$ ns
*** glibc detected *** ns: realloc(): invalid next size: 0x09923380 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(+0x6b591)[0xb73c7591]
/lib/tls/i686/cmov/libc.so.6(+0x70cbd)[0xb73cccbd]
/lib/tls/i686/cmov/libc.so.6(realloc+0xdd)[0xb73ccf9d]
ns(TclpRealloc+0x24)[0x8473a14]
ns(Tcl_Realloc+0x29)[0x83f7d89]
ns(Tcl_SetObjLength+0x7a)[0x8452d6a]
ns(TclpNativeJoinPath+0xb5)[0x84278a5]
ns(Tcl_FSJoinPath+0x3d5)[0x84391a5]
ns(Tcl_JoinPath+0x6c)[0x842604c]
ns(TclpInitLibraryPath+0x755)[0x8467c15]
ns[0x841642a]
ns(Tcl_FindExecutable+0x9c)[0x841658c]
ns(Tcl_Main+0x43)[0x843fa63]
ns(nslibmain+0x20)[0x83e73c0]
ns(main+0x1b)[0x83e7533]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0xb7372bd6]
ns[0x81ab931]
======= Memory map: ========
08048000-0858f000 r-xp 00000000 08:11 3821817    /home/abdusy/ns-allinone-2.34-uu/ns-2.34/ns
0858f000-08590000 r--p 00547000 08:11 3821817    /home/abdusy/ns-allinone-2.34-uu/ns-2.34/ns
08590000-0862c000 rw-p 00548000 08:11 3821817    /home/abdusy/ns-allinone-2.34-uu/ns-2.34/ns
0862c000-08635000 rw-p 00000000 00:00 0
0991f000-09940000 rw-p 00000000 00:00 0          [heap]
b7200000-b7221000 rw-p 00000000 00:00 0
b7221000-b7300000 ---p 00000000 00:00 0
b7336000-b7338000 rw-p 00000000 00:00 0
b7338000-b733c000 r-xp 00000000 08:11 2362319    /usr/lib/libXdmcp.so.6.0.0
b733c000-b733d000 r--p 00003000 08:11 2362319    /usr/lib/libXdmcp.so.6.0.0
b733d000-b733e000 rw-p 00004000 08:11 2362319    /usr/lib/libXdmcp.so.6.0.0
b733e000-b7340000 r-xp 00000000 08:11 2362308    /usr/lib/libXau.so.6.0.0
b7340000-b7341000 r--p 00001000 08:11 2362308    /usr/lib/libXau.so.6.0.0
b7341000-b7342000 rw-p 00002000 08:11 2362308    /usr/lib/libXau.so.6.0.0
b7342000-b735a000 r-xp 00000000 08:11 2363315    /usr/lib/libxcb.so.1.1.0
b735a000-b735b000 r--p 00017000 08:11 2363315    /usr/lib/libxcb.so.1.1.0
b735b000-b735c000 rw-p 00018000 08:11 2363315    /usr/lib/libxcb.so.1.1.0
b735c000-b74af000 r-xp 00000000 08:11 1311160    /lib/tls/i686/cmov/libc-2.11.1.so
b74af000-b74b0000 ---p 00153000 08:11 1311160    /lib/tls/i686/cmov/libc-2.11.1.so
b74b0000-b74b2000 r--p 00153000 08:11 1311160    /lib/tls/i686/cmov/libc-2.11.1.so
b74b2000-b74b3000 rw-p 00155000 08:11 1311160    /lib/tls/i686/cmov/libc-2.11.1.so
b74b3000-b74b7000 rw-p 00000000 00:00 0
b74b7000-b74d4000 r-xp 00000000 08:11 1310896    /lib/libgcc_s.so.1
b74d4000-b74d5000 r--p 0001c000 08:11 1310896    /lib/libgcc_s.so.1
b74d5000-b74d6000 rw-p 0001d000 08:11 1310896    /lib/libgcc_s.so.1
b74d6000-b75bf000 r-xp 00000000 08:11 2363213    /usr/lib/libstdc++.so.6.0.13
b75bf000-b75c0000 ---p 000e9000 08:11 2363213    /usr/lib/libstdc++.so.6.0.13
b75c0000-b75c4000 r--p 000e9000 08:11 2363213    /usr/lib/libstdc++.so.6.0.13
b75c4000-b75c5000 rw-p 000ed000 08:11 2363213    /usr/lib/libstdc++.so.6.0.13
b75c5000-b75cc000 rw-p 00000000 00:00 0
b75cc000-b75f0000 r-xp 00000000 08:11 1311164    /lib/tls/i686/cmov/libm-2.11.1.so
b75f0000-b75f1000 r--p 00023000 08:11 1311164    /lib/tls/i686/cmov/libm-2.11.1.so
b75f1000-b75f2000 rw-p 00024000 08:11 1311164    /lib/tls/i686/cmov/libm-2.11.1.so
b75f2000-b75f4000 r-xp 00000000 08:11 1311163    /lib/tls/i686/cmov/libdl-2.11.1.so
b75f4000-b75f5000 r--p 00001000 08:11 1311163    /lib/tls/i686/cmov/libdl-2.11.1.so
b75f5000-b75f6000 rw-p 00002000 08:11 1311163    /lib/tls/i686/cmov/libdl-2.11.1.so
b75f6000-b7609000 r-xp 00000000 08:11 1311166    /lib/tls/i686/cmov/libnsl-2.11.1.so
b7609000-b760a000 r--p 00012000 08:11 1311166    /lib/tls/i686/cmov/libnsl-2.11.1.so
b760a000-b760b000 rw-p 00013000 08:11 1311166    /lib/tls/i686/cmov/libnsl-2.11.1.so
b760b000-b760e000 rw-p 00000000 00:00 0
b760e000-b7727000 r-xp 00000000 08:11 2362304    /usr/lib/libX11.so.6.3.0
b7727000-b7728000 r--p 00118000 08:11 2362304    /usr/lib/libX11.so.6.3.0
b7728000-b772a000 rw-p 00119000 08:11 2362304    /usr/lib/libX11.so.6.3.0
b772a000-b772b000 rw-p 00000000 00:00 0
b772b000-b7739000 r-xp 00000000 08:11 2362321    /usr/lib/libXext.so.6.4.0
b7739000-b773a000 r--p 0000d000 08:11 2362321    /usr/lib/libXext.so.6.4.0
b773a000-b773b000 rw-p 0000e000 08:11 2362321    /usr/lib/libXext.so.6.4.0
b774b000-b774d000 rw-p 00000000 00:00 0
b774d000-b774e000 r-xp 00000000 00:00 0          [vdso]
b774e000-b7769000 r-xp 00000000 08:11 1311004    /lib/ld-2.11.1.so
b7769000-b776a000 r--p 0001a000 08:11 1311004    /lib/ld-2.11.1.so
b776a000-b776b000 rw-p 0001b000 08:11 1311004    /lib/ld-2.11.1.so
bf9cd000-bf9ee000 rw-p 00000000 00:00 0          [stack]
Aborted

I don’t know how to solve this problem. I’ve asked to forum and mailing list. But there is no answer.

2 thoughts on “Problem with stack or memory allocation in NS-2”

  1. hi,
    I am working on ns-2.29 and i am implementing an energy efficient AODV protocol. There is the code available for AODV in usr/local/ns-allinone-2.29/ns-2.29/aodv/..
    I dont know which tcl script to run the code. I would be really grateful to u if u could help me out.
    thanks

Leave a Reply

Your email address will not be published. Required fields are marked *