Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-14-2012, 08:56 AM   #1
LQ Newbie
Registered: May 2012
Posts: 1

Rep: Reputation: Disabled
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
Starting Simulation...

Program received signal SIGSEGV, Segmentation fault.
0x00597f25 in fgets () from /lib/
(gdb) bt
#0 0x00597f25 in fgets () from /lib/
#1 0x00382aa6 in ?? () from /lib/
#2 0x00380c6d in BIO_gets () from /lib/
#3 0x003bdfc8 in PEM_read_bio () from /lib/
#4 0x003bf73b in PEM_bytes_read_bio () from /lib/
#5 0x003c2d9f in PEM_read_bio_PrivateKey () from /lib/
#6 0x003c3129 in PEM_read_PrivateKey () from /lib/
#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

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/
Can't find member of namespace, class, struct, or union named "/home/user/ns-allinone-2.34/ns-2.34/scm_olsr/"
Hint: try '/home/user/ns-allinone-2.34/ns-2.34/scm_olsr/<TAB> or '/home/user/ns-allinone-2.34/ns-2.34/scm_olsr/<ESC-?>
(Note leading single quote.)
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) quit

thank you in advance


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Agentj and Ns2 Question Segmentation fault krabieh Linux - Newbie 0 10-11-2011 06:41 PM
ns2.34 Segmentation fault over Ubuntu 11.04 Amro1 Ubuntu 7 09-28-2011 08:24 AM
yast segmentation fault, system freezing - nvidia driver at fault? BaltikaTroika SUSE / openSUSE 2 12-02-2005 09:34 AM
segmentation fault tej Linux - Hardware 1 02-08-2005 12:27 AM
Segmentation Fault (What is that?) jlacroix Fedora 6 11-17-2003 08:32 PM

All times are GMT -5. The time now is 10:14 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration