LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-16-2018, 05:50 AM   #1
ariefhi
LQ Newbie
 
Registered: Aug 2018
Posts: 9

Rep: Reputation: Disabled
Exclamation [Segmentation fault (core dumped)]


Hi everyone
i run my program aodv18.tcl, but it got problem Segmentation fault (core dump), the detail of error message as below :
(gdb) run aodv18.tcl
Starting program: /usr/local/bin/ns aodv18.tcl
num_nodes is set 12
warning: Please use -channel as shofile:///home/arief-pc/ns-allinone-2.35/ns-2.35/aodv/aodv.cc
file:///home/arief-pc/ns-allinone-2.35/ns-2.35/aodv/aodv.h
file:///home/arief-pc/ns-allinone-2.35/ns-2.35/aodv/aodv.cc
file:///home/arief-pc/ns-allinone-2.35/ns-2.35/aodv/aodv.h
wn in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
( 1) - 2 sending Route Request, dst: 8
( 2) - 2 sending Route Request, dst: 8, tout 1.800000 ms
( 3) - 5 sending Route Request, dst: 0
( 4) - 5 sending Route Request, dst: 0, tout 1.800000 ms
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!

Program received signal SIGSEGV, Segmentation fault.
AODV::forward (this=0x10a70e0, rt=0x0, p=0x110c8d0, delay=1)
at aodv/aodv.cc:1025
warning: Source file is more recent than executable.
1025 #endif // DEBUG

i hard to solve that but not find problem, anyone help me to solve that
pleasae

file aodv.cc https://mega.nz/#!DjY1TCLL!jMdKxP4sy...zxfitzpqaJw4SI
file aodv.h https://mega.nz/#!unBlRIjA!I0NvjMi8Y...GFn_Fd61Lw11Z4
 
Old 10-17-2018, 01:17 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by ariefhi View Post
warning: Please use -channel as shofile:///home/arief-pc/ns-allinone-2.35/ns-2.35/aodv/aodv.cc
Some output is missing here.
Quote:
wn in tcl/ex/wireless-mitf.tcl
OK, this is the missing text. Why is it mixed with other output?
Quote:
Program received signal SIGSEGV, Segmentation fault.
AODV::forward (this=0x10a70e0, rt=0x0, p=0x110c8d0, delay=1)
at aodv/aodv.cc:1025
warning: Source file is more recent than executable.
I suggest you first ensure that executable and source code have the same version.
 
Old 10-17-2018, 02:33 AM   #3
ariefhi
LQ Newbie
 
Registered: Aug 2018
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
Some output is missing here.

OK, this is the missing text. Why is it mixed with other output?

I suggest you first ensure that executable and source code have the same version.
i had try same version but not working, when i run using gdb, the detail message error as below :
Starting program: /usr/local/bin/ns Ujicobaprog.tcl
warning: Script debugging disabled. Reconfigure with --with-tcldebug, and recompile.
num_nodes is set 2
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Starting Simulation...
0 - command: calling set_destination()
0 - set_destination: calling log_movement()
( 1) - 0 sending Route Request, dst: 1
( 2) - 0 sending Route Request, dst: 1, tout 1.800000 ms
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
( 3) - 0 sending Route Request, dst: 1
( 4) - 0 sending Route Request, dst: 1, tout 3.600000 ms
( 5) - 0 sending Route Request, dst: 1
( 6) - 0 sending Route Request, dst: 1, tout 5.400000 ms
( 7) - 0 sending Route Request, dst: 1
( 8) - 0 sending Route Request, dst: 1, tout 7.200000 ms
( 9) - 0 sending Route Request, dst: 1
(10) - 0 sending Route Request, dst: 1, tout 1.800000 ms
(11) - 0 sending Route Request, dst: 1
(12) - 0 sending Route Request, dst: 1, tout 3.600000 ms
(13) - 0 sending Route Request, dst: 1
(14) - 0 sending Route Request, dst: 1, tout 5.400000 ms
1 - command: calling set_destination()
1 - set_destination: calling log_movement()
(15) - 0 sending Route Request, dst: 1
(16) - 0 sending Route Request, dst: 1, tout 7.200000 ms
(17) - 0 sending Route Request, dst: 1
(18) - 0 sending Route Request, dst: 1, tout 1.800000 ms
1 - recvRequest: destination sending reply
sending Reply from 1 at 103.00
1 - arpresolve
0 - arpinput
op: 1, sha: 1, tha: 0, spa: 1, tpa: 0
1 - arpinput
op: 2, sha: 0, tha: 1, spa: 0, tpa: 1
sending HELD packet.
0 - recvReply: received a REPLY

Program received signal SIGSEGV, Segmentation fault.
AODV::forward (this=0xebdaf0, rt=0xf51620, p=0xf4ea60, delay=0)
at aodv/aodv.cc:1025
1025 #endif // DEBUG
(gdb) bt
#0 AODV::forward (this=0xebdaf0, rt=0xf51620, p=0xf4ea60, delay=0)
at aodv/aodv.cc:1025
#1 0x00000000006097a3 in AODV::recvReply (this=0xebdaf0, p=0xf4eb50)
at aodv/aodv.cc:911
#2 0x000000000051d186 in Scheduler::run (this=0xe876c0)
at common/scheduler.cc:129
#3 0x000000000051dccc in Scheduler::command (this=0xe876c0,
argc=<optimized out>, argv=<optimized out>) at common/scheduler.cc:198
#4 0x00000000006cf5d5 in OTclDispatch (cd=<optimized out>, in=0xb72f00,
argc=3, argv=0xb742f0) at otcl.c:455
#5 0x00000000006d4b90 in TclInvokeStringCommand ()
#6 0x00000000006d8ee7 in TclEvalObjvInternal ()
#7 0x000000000071ed1b in TclExecuteByteCode ()
#8 0x00000000007257e7 in TclCompEvalObj ()
#9 0x000000000071faf1 in TclExecuteByteCode ()
#10 0x000000000075cf5b in TclObjInterpProcCore ()
#11 0x00000000006d4cdd in TclInvokeObjectCommand ()
#12 0x00000000006cf705 in OTclDispatch (cd=<optimized out>, in=0xb72f00,
argc=2, argv=0xb740f0) at otcl.c:498
#13 0x00000000006d4b90 in TclInvokeStringCommand ()
#14 0x00000000006d8ee7 in TclEvalObjvInternal ()
#15 0x000000000071ed1b in TclExecuteByteCode ()
#16 0x000000000075cf5b in TclObjInterpProcCore ()
---Type <return> to continue, or q <return> to quit---
#17 0x00000000006d4cdd in TclInvokeObjectCommand ()
#18 0x00000000006cf5d5 in OTclDispatch (cd=<optimized out>, in=0xb72f00,
argc=2, argv=0xb73ed0) at otcl.c:455
#19 0x00000000006d4b90 in TclInvokeStringCommand ()
#20 0x00000000006d8ee7 in TclEvalObjvInternal ()
#21 0x00000000006daa8b in TclEvalEx ()
#22 0x00000000006dafc6 in Tcl_EvalEx ()
#23 0x000000000073f3ca in Tcl_FSEvalFileEx ()
#24 0x0000000000744f13 in Tcl_Main ()
#25 0x00000000006cb63e in nslibmain (argc=<optimized out>,
argv=<optimized out>) at common/tclAppInit.cc:67
#26 0x00007ffff700ef45 in __libc_start_main (
main=0x514270 <main(int, char**)>, argc=2, argv=0x7fffffffdd18,
init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,
stack_end=0x7fffffffdd08) at libc-start.c:287
#27 0x0000000000514305 in _start ()

i do not know how to trace that, can you help me to trace my issue?
 
Old 10-17-2018, 06:06 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Since I know close to nothing about ns or tcl, I can only look at the C++ program. The segmentation fault is caused by
Code:
fprintf(stderr, "%s: calling drop()\n", __PRETTY_FUNCTION__);
which makes me think that __PRETTY_FUNCTION__ is the culprit.

Since this line is only executed when DEBUG is defined, I wanted to recommend disabling DEBUG, but your output contains
Code:
warning: Script debugging disabled. Reconfigure with --with-tcldebug, and recompile
Confusing!
 
Old 10-17-2018, 02:44 PM   #5
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
You can change to following two options.
1)fprintf(stderr, "calling drop()\n");
2)fprintf(stderr, "%s: calling drop()\n", __FUNCTION__);
 
  


Reply

Tags
ns2



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
[SOLVED] Segmentation fault (core dumped) AlexBB Linux - Newbie 4 12-16-2014 07:23 AM
Segmentation fault (core dumped) mohammad taqy bayat Linux - Newbie 3 08-25-2014 02:10 AM
Segmentation fault (core dumped) sirjase Programming 8 12-18-2013 03:40 AM
Segmentation fault (core dumped) plisken Linux - General 8 09-17-2003 03:32 AM
Segmentation fault (core dumped) hasanaydin Linux - General 0 03-27-2002 07:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:45 PM.

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