A segmentation fault in NS2
Indeed, I integrate a new routing protocol in ns2, I compiled it, there was no error, but when I run a Tcl script, I get the error "segmentation fault". I ran the script with the gdb debugger, this is what he gave me:
(gdb) run simple-wireless1.tcl ns
Starting program: /home/user/Bureau/Version_ns-2.34/ns-allinone-2.34/ns-2.34/ns simple-wireless1.tcl ns
num_nodes is set 2
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Starting Simulation...
Program received signal SIGSEGV, Segmentation fault.
0x00597f25 in fgets () from /lib/libc.so.6
(gdb) bt
#0 0x00597f25 in fgets () from /lib/libc.so.6
#1 0x00382aa6 in ?? () from /lib/libcrypto.so.0.9.8
#2 0x00380c6d in BIO_gets () from /lib/libcrypto.so.0.9.8
#3 0x003bdfc8 in PEM_read_bio () from /lib/libcrypto.so.0.9.8
#4 0x003bf73b in PEM_bytes_read_bio () from /lib/libcrypto.so.0.9.8
#5 0x003c2d9f in PEM_read_bio_PrivateKey () from /lib/libcrypto.so.0.9.8
#6 0x003c3129 in PEM_read_PrivateKey () from /lib/libcrypto.so.0.9.8
#7 0x082ed4d3 in keyUtil_read_private_key_from_file(char*) ()
#8 0x082f041c in SCM_OLSR::SCM_OLSR(int) ()
#9 0x082faf6a in SCM_OLSRClass::create(int, char const* const*) ()
#10 0x08411b90 in TclClass::create_shadow(void*, Tcl_Interp*, int, char const**) ()
#11 0x08415b96 in OTclDispatch (cd=<value optimized out>, in=0x8673558,
argc=3, argv=0xbfff9ca0) at otcl.c:434
#12 0x0841a79e in TclInvokeStringCommand ()
#13 0x0841c4a3 in TclEvalObjvInternal ()
#14 0x0844885a in TclExecuteByteCode ()
#15 0x0844caed in TclCompEvalObj ()
#16 0x08448b73 in TclExecuteByteCode ()
#17 0x0844caed in TclCompEvalObj ()
#18 0x08476b67 in TclObjInterpProc ()
#19 0x08477020 in TclProcInterpProc ()
#20 0x08416726 in OTclNextMethod (obj=0x8853330, in=0x8673558, argc=5,
---Type <return> to continue, or q <return> to quit---q
argv=0xbfQuit
I could not locate the error, stating that the same script works with the protocol AODV and OLSR.
I ask you please to help me to solve this error
another question is how to insert a breakpoint at the function of my new protocol, because I tried, but i get an error as follows:
(gdb) b /home/user/ns-allinone-2.34/ns-2.34/scm_olsr/SCM_OLSR.cc
Can't find member of namespace, class, struct, or union named "/home/user/ns-allinone-2.34/ns-2.34/scm_olsr/SCM_OLSR.cc"
Hint: try '/home/user/ns-allinone-2.34/ns-2.34/scm_olsr/SCM_OLSR.cc<TAB> or '/home/user/ns-allinone-2.34/ns-2.34/scm_olsr/SCM_OLSR.cc<ESC-?>
(Note leading single quote.)
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) quit
thank you in advance
|