LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Segmentation fault (core dumped). SORTING LISTS.... DONE! not performed in NS2 (https://www.linuxquestions.org/questions/linux-newbie-8/segmentation-fault-core-dumped-sorting-lists-done-not-performed-in-ns2-4175626763/)

Beky 07-11-2019 03:51 AM

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.

knudfl 07-11-2019 05:48 AM

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.

-

Beesu19 08-22-2019 02:32 PM

Segmentation Fault in NS2 when running modified TCP algorithm
 
Quote:

Originally Posted by knudfl (Post 6014041)
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::operator=(int) ()
(gdb) bt
#0 0x00000000005ea396 in TracedInt::operator=(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,

knudfl 08-22-2019 06:32 PM

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


-

Beesu19 08-22-2019 08:18 PM

Quote:

Originally Posted by knudfl (Post 6028417)
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,

knudfl 08-23-2019 07:00 AM

1 Attachment(s)
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.
-

Beesu19 08-23-2019 08:26 AM

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.

knudfl 08-23-2019 08:56 AM

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.

-


All times are GMT -5. The time now is 06:30 AM.