LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-11-2019, 03:51 AM   #16
Beky
LQ Newbie
 
Registered: Jul 2019
Posts: 1

Rep: Reputation: Disabled
I just encountered the same problem(Segmentation fault (core dumped)) after clonning my protocol. May I get any help?


I've cloned the protocol which I've been working on successfully. But when I try to run my network topology(.tc file) using my new protocol I encountered "Segmentation fault (core dumped)" on the terminal. My nam is working successfully using the original protocol. It(the nam) even works when I tried to run my .tcl file using other protocols like AODV,AOMDV. How can I fix this problem? Any help is appreciated.
 
Old 07-11-2019, 05:48 AM   #17
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,267

Rep: Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568
Post #16, @Beky : Welcome to LQ.

ns2 is ancient. Things that were possible 15 years ago may not work any more.

Besides that, some protocols / some simulations will cause `Segmentation faultī.
If `Segmentation faultī appears after the creation of the trace files, then it can be ignored.

Anyway, your question is not possible to answer without knowing the C++ code and the simulation.tcl .

Suggest : Upload the files to e.g. Dropbox or Google Drive, and post a copy of a shared link.

-
 
Old 08-22-2019, 02:32 PM   #18
Beesu19
LQ Newbie
 
Registered: Aug 2019
Posts: 5

Rep: Reputation: Disabled
Segmentation Fault in NS2 when running modified TCP algorithm

Quote:
Originally Posted by knudfl View Post
Post #16, @Beky : Welcome to LQ.

ns2 is ancient. Things that were possible 15 years ago may not work any more.

Besides that, some protocols / some simulations will cause `Segmentation faultī.
If `Segmentation faultī appears after the creation of the trace files, then it can be ignored.

Anyway, your question is not possible to answer without knowing the C++ code and the simulation.tcl .

Suggest : Upload the files to e.g. Dropbox or Google Drive, and post a copy of a shared link.

-
Hello Knudfi,

I also have a similar problem at the moment (I am using TCP-Linux module in NS-2.35 on Ubuntu 18.10 ) and I don't know how to solve that, hopefully, you could help us. Please, what would you recommend? see below what I got after backtracing using GDB:

(gdb) run hybic2lnx.tcl
Starting program: /home/name/ns-allinone-2.35/bin/ns hybic2lnx.tcl
cmd select_ca hybic


Program received signal SIGSEGV, Segmentation fault.
0x00000000005ea396 in TracedInt:perator=(int) ()
(gdb) bt
#0 0x00000000005ea396 in TracedInt:perator=(int) ()
#1 0x000000000061c766 in LinuxTcpAgent::send_much(int, int, int) ()
#2 0x000000000061bf10 in LinuxTcpAgent::recv(Packet*, Handler*) ()
#3 0x00000000005db1a0 in Classifier::recv(Packet*, Handler*) ()
#4 0x00000000005db1a0 in Classifier::recv(Packet*, Handler*) ()
#5 0x00000000005d7605 in Connector::send(Packet*, Handler*) ()
#6 0x00000000005d936f in Trace::recv(Packet*, Handler*) ()
#7 0x00000000005d7605 in Connector::send(Packet*, Handler*) ()
#8 0x00000000005d7a81 in TTLChecker::recv(Packet*, Handler*) ()
#9 0x00000000005d21b4 in NsObject::handle(Event*) ()
#10 0x00000000005cea9d in Scheduler::dispatch(Event*, double) ()
#11 0x00000000005ce9b5 in Scheduler::run() ()
#12 0x00000000005cebc8 in Scheduler::command(int, char const* const*) ()
#13 0x00000000008431e2 in TclClass::dispatch_cmd(void*, Tcl_Interp*, int, char const**) ()
#14 0x000000000084767b in OTclDispatch (cd=<optimized out>, in=0xb5c140, argc=3, argv=0xb5d530) at otcl.c:455
#15 0x000000000084c80b in TclInvokeStringCommand ()
#16 0x0000000000851428 in TclEvalObjvInternal ()
#17 0x00000000008993fe in TclExecuteByteCode ()
#18 0x000000000089faa9 in TclCompEvalObj ()
#19 0x000000000089936c in TclExecuteByteCode ()
#20 0x00000000008d9266 in TclObjInterpProcCore ()
#21 0x000000000084c952 in TclInvokeObjectCommand ()
#22 0x000000000084780b in OTclDispatch (cd=<optimized out>, in=0xb5c140, argc=2, argv=0xb5d330) at otcl.c:498
#23 0x000000000084c80b in TclInvokeStringCommand ()
#24 0x0000000000851428 in TclEvalObjvInternal ()
#25 0x00000000008993fe in TclExecuteByteCode ()
#26 0x00000000008d9266 in TclObjInterpProcCore ()
#27 0x000000000084c952 in TclInvokeObjectCommand ()
#28 0x000000000084767b in OTclDispatch (cd=<optimized out>, in=0xb5c140, argc=2, argv=0xb5d110) at otcl.c:455
#29 0x000000000084c80b in TclInvokeStringCommand ()
#30 0x0000000000851428 in TclEvalObjvInternal ()
#31 0x0000000000852a1f in TclEvalEx ()
#32 0x0000000000853193 in Tcl_EvalEx ()
#33 0x00000000008bac2a in Tcl_FSEvalFileEx ()
#34 0x00000000008c0b03 in Tcl_Main ()
#35 0x0000000000842151 in nslibmain ()
#36 0x00000000008422c4 in main ()

However, the c code (mytcp.c) of the new protocol compiled successfully and generate the binary file (mytcp.o), but the trace data file is empty. Also, the same .tcl code works and generates trace data when I replaced my modified algorithm with any of the TCP-Linux such as highspeed, which returned the following message at the end;

(gdb) run hybic2lnx.tcl
Starting program: /home/name/ns-allinone-2.35/bin/ns hybic2lnx.tcl
cmd select_ca highspeed
[Inferior 1 (process 13212) exited normally]

Thank you,
 
Old 08-22-2019, 06:32 PM   #19
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,267

Rep: Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568
Post #18, @Beesu19 : Welcome to LQ.

Segmentation fault : Like your posting says →
Quote:
Upload the files to e.g. Dropbox or Google Drive, and post a copy of a shared link
I.e. hybic2lnx.tcl and mytcp.c


-
 
2 members found this post helpful.
Old 08-22-2019, 08:18 PM   #20
Beesu19
LQ Newbie
 
Registered: Aug 2019
Posts: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Post #18, @Beesu19 : Welcome to LQ.

Segmentation fault : Like your posting says →

I.e. hybic2lnx.tcl and mytcp.c


-
Thanks, Knudfi for your response and offering to help. see the links to the files requested below;

https://www.dropbox.com/s/0kfnlx3xmg...c2lnx.tcl?dl=0

https://www.dropbox.com/s/nt8tpx1jizecwxu/hbc.c?dl=0

Thank you,
 
Old 08-23-2019, 07:00 AM   #21
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,267

Rep: Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568
Re #20 : Please do not quote entire posts. A "one word reference" will do.

Tested copies of hybic2lnx.tcl with various "tcp":
highspeed_tcp.tcl hybic2lnx.tcl hybla_tcp.tcl vegas_tcp.tcl
$ ./ns235-tcp_hybic-2 hybic2lnx.tcl
Your "hybic2lnx" simulation fails with `Segmentation faultī, no issues with highspeed, hybla, vegas.
I also tested with older OSīs, CentOS 6 - i686, CentOS 6 - x86_64 : Same result.

I guess you could try making the code simpler, to make it easier to spot the error.
-
Attached Files
File Type: txt tcp_hybic_ns235.patch.txt (14.0 KB, 2 views)

Last edited by knudfl; 08-23-2019 at 07:02 AM.
 
1 members found this post helpful.
Old 08-23-2019, 08:26 AM   #22
Beesu19
LQ Newbie
 
Registered: Aug 2019
Posts: 5

Rep: Reputation: Disabled
Re #21: Thank you for the help

I did the same thing running other protocols and it works. I also tried with Ubuntu 14.04.5 and a similar error returned!

I thought there is a mistake in the memory allocation using my structure (hybic{}), or problem with the linkage of C and OTCL, but I don't know how to allocate more memory for the modified algorithm. Would you mind guiding me on how to allocate more memory and make the effective linkage with OTCL.
 
Old 08-23-2019, 08:56 AM   #23
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,267

Rep: Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568
Re #22.

Sorry, I don't do coding.

About `segmentation fault ns2ī https://www.linuxquestions.org/quest...20fault%20ns2/
→ → https://www.linuxquestions.org/quest...-4175530493/#2
https://www.linuxquestions.org/quest...-4175506731/#4 "The implementation of the Packet data structure of NS2 does not match the realities.

-
 
  


Reply

Tags
ns2, taodv


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
Segmentation fault (core dumped)- SMAC on NS2 Emma112 Linux - Newbie 1 10-29-2017 10:23 AM
Segmentation fault (core dumped) micflunu Linux - Newbie 2 07-26-2016 07:10 AM
segmentation fault (core dumped ) error in ns2.34 sims2801 Linux - Newbie 3 05-29-2015 07:17 AM
[SOLVED] Segmentation fault (core dumped) AlexBB Linux - Newbie 4 12-16-2014 07:23 AM
Segmentation fault (core dumped) eytan *BSD 3 04-27-2005 08:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:58 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration