Hi all,
I have recently implemented a new protocol in NS2.
The new protocol is based on the OLSR routing protocol, which runs correctly
in NS2 before any modification.
The compilation was successful, but when I tried to run NS2, I got the
following error messages:

*** glibc detected *** ns: realloc(): invalid next size: 0x09150380 ***
======= Backtrace: =========
/lib/libc.so.6[0x696efd]
/lib/libc.so.6(realloc+0x19d)[0x698ebd]
ns(TclpRealloc+0x24)[0x8496b64]
ns(Tcl_Realloc+0x2c)[0x8421fbc]
ns(Tcl_SetObjLength+0x7a)[0x8477f5a]
ns(TclpNativeJoinPath+0xa8)[0x844d828]
ns(Tcl_FSJoinPath+0x368)[0x845ffa8]
ns(Tcl_JoinPath+0x68)[0x844d5d8]
ns(TclpInitLibraryPath+0x5d7)[0x848b7a7]
ns[0x843eaf0]
ns(Tcl_FindExecutable+0x91)[0x843ec41]
ns(Tcl_Main+0x2b)[0x84663fb]
ns(nslibmain+0x20)[0x840f6d2]
ns(main+0x22)[0x840f72e]
/lib/libc.so.6(__libc_start_main+0xdc)[0x641e8c]
ns(__gxx_personality_v0+0x331)[0x81abb41]
======= Memory map: ========
00497000-004a2000 r-xp 00000000 fd:00 1967695
/lib/libgcc_s-4.1.2-20080825.so.1
004a2000-004a3000 rwxp 0000a000 fd:00 1967695
/lib/libgcc_s-4.1.2-20080825.so.1
005e9000-005ea000 r-xp 005e9000 00:00 0          [vdso]
0060e000-00628000 r-xp 00000000 fd:00 1967671    /lib/ld-2.5.so
00628000-00629000 r-xp 00019000 fd:00 1967671    /lib/ld-2.5.so
00629000-0062a000 rwxp 0001a000 fd:00 1967671    /lib/ld-2.5.so
0062c000-0076a000 r-xp 00000000 fd:00 1967672    /lib/libc-2.5.so
0076a000-0076c000 r-xp 0013e000 fd:00 1967672    /lib/libc-2.5.so
0076c000-0076d000 rwxp 00140000 fd:00 1967672    /lib/libc-2.5.so
0076d000-00770000 rwxp 0076d000 00:00 0
00772000-00797000 r-xp 00000000 fd:00 1967679    /lib/libm-2.5.so
......
......
......
//
//
//
// I have googled the problem, it seems to be a matter of memory management.

However, I did not use the realloc() function when programming.
Except that I implemented some containers like vector, map, and map of maps,
map of vectors.

Could this caused by these containers? Like when one tries to allocate new
container, or delete elements from containers.

I am trying to find any possible logical bugs in my program, but this is
really urgent.
Any help will be appreciated.
Edward.

Reply via email to