LinuxQuestions.org
Register a domain and help support LQ
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 03-24-2014, 09:11 PM   #1
sarf2k4
LQ Newbie
 
Registered: Mar 2014
Posts: 6

Rep: Reputation: Disabled
aodv-uu segmentation fault on ns2.34


Hi, I successfully patched aodv-uu-0.9.5 into my ns-2.34 with g++ and gcc 4.1.2 on ubuntu 10.04 (on other machine) and ran an initial test using AODVUU routing protocol, it is a success without any errors.

However, when I tried using the second terminal window, or other tcl scripts, it returned a "segmentation fault" error all of a sudden. I searched some of the solutions and I don't think those solution matches my kind of errors. I've been trying to make AODV-UU to work on my ns2 for a month now and made no progress

Please guide me in a detailed instruction as I am not too keen of Linux terminal commands and other things.

Thank you in advance
 
Old 03-25-2014, 05:01 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
Welcome to LQ.

What is "a second terminal" ?
Do you mean "running two simulations" at the same time ?

Generally : ns2 has it's limitations. "Segmentation fault" is easy to achieve.
Some simulations have a maximum of 14 nodes. Some 50+.

http://www.cs.binghamton.edu/~kliu/r...2code/#speedup :
"The implementation of the Packet data structure of NS2 does not math the realities.
The packet in ns2 simulation keeps all packet headers for any protocols implemented in NS2.
For example, a DSR routing packet may keep DSDV, AODV, or even a PING application header.
For this reason, till today, a packet used in ns2 simulation, would have a header size around 40~64KB.
And NO packet would be deleted to release the memory it holds until the end of the simulation.
So for a typical simulation with 100 nodes in ns2 around 1M packets exchanged (of course,
you may reuse the packets already being freed through Packet::free(Packet*).
To learn the implementation of it, please check file common/packet{.h,.cc} ),
you may hold 10% of it, 100K packets, and you may use a memory at least 100K*64KB -> 6.4GB,
which definitely would crash your computer (even it is a super server)."

http://network-simulator-ns-2.7690.n...36.html#a26937
"NS2 does not have automatic garbage collection, thus warrants a manual
freeing of allocated memory once an object is no longer needed."

-
 
Old 03-25-2014, 08:29 PM   #3
sarf2k4
LQ Newbie
 
Registered: Mar 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Actually I opened two terminals at a time, the first one I tried with aodv-uu routing protocol, it succeeded, but the second terminal returned that error. I tried on other machine, ubuntu 10.04lts, I got gcc-4.1 installed and selected as default (even though no other versions installed), in fact two machines with ns-2.32 and ns-2.34, patched aodv-uu-0.9.5, surprisingly there are no errors and runs smoothly.

Truely sorry for this thread mr. knudfl . But I hope the information helps, ns-2 runs without a hitch with gcc-4.1 especially if want to patch aodv-uu or any other packet types (I think).

Is there a guide to install gcc-4.1 on ubuntu 12.04 using the apt-get method? I enabled the lucid source by removing the comment, and get the following error.

Code:
sudo apt-get install gcc-4.1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 gcc-4.1 : Depends: binutils (>= 2.17cvs20070426) but it is not going to be installed
 libatk-wrapper-java : Depends: default-jre but it is not going to be installed or
                                java2-runtime
 libatk-wrapper-java-jni : Depends: default-jre but it is not going to be installed or
                                    java2-runtime
 libgcc1 : Breaks: gcc-4.1 but 4.1.2-27ubuntu1 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
While running ns only I'd get this error
Code:
ns: /usr/local/lib/libstdc++.so.6: no version information available (required by ns)
ns: /usr/local/lib/libstdc++.so.6: no version information available (required by ns)
ns: /usr/local/lib/libstdc++.so.6: no version information available (required by ns)
ns: /usr/local/lib/libstdc++.so.6: no version information available (required by ns)
ns: /usr/local/lib/libstdc++.so.6: no version information available (required by ns)
%
And lastly, is there a command to check which gcc/g++ has been installed?

Thank you for your reply
 
Old 03-26-2014, 04:10 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
# 3 .
Quote:
Is there a guide to install gcc-4.1 on ubuntu 12.04 using the apt-get method ?
I enabled the lucid source by removing the comment, and get the following error
No old Ubuntu compilers (from 8.04 or 10.04) will work with Ubuntu 11.04 .. 13.xx ..
However, compatible gcc41/g++41 have been created :
For 12.04 - 32bits = i686, see post #18 here ...
http://www.linuxquestions.org/questi...022/page2.html


Quote:
ns: /usr/local/lib/libstdc++.so.6
You are not supposed to have a libstdc++.so.6 in /usr/local/ !
** Manually installed gcc/g++ files in /usr/local/lib/ : Please uninstall / delete.
And install the ns2 prerequisites :
$ sudo apt-get install g++ g++-4.4 autoconf automake libtool libxmu-dev xgraph

OLSR info http://www.linuxquestions.org/questions/tags/olsr/
→ → The build command for all ns-allinone-2.26 ... 2.34 is :
$ cd ns-allinone-2.xx/ && export CC=gcc41 CXX=g++41 && ./install

-

Last edited by knudfl; 03-26-2014 at 04:12 AM.
 
Old 03-31-2014, 04:25 AM   #5
sarf2k4
LQ Newbie
 
Registered: Mar 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thank you for your reply, I got this error after executing the install procedure for ns-2.34

Code:
configure: WARNING: unrecognized options: --enable-gcc
gcc41-4.4 -c -O2  -pipe  -DTCL_DBGX= -Wall -Wno-implicit-int -fno-strict-aliasing -fPIC -I. -I/home/user/ns/ns-allinone-2.34/tcl8.4.18/unix/../generic -I/home/user/ns/ns-allinone-2.34/tcl8.4.18/unix -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DSTATIC_BUILD=1 -DPEEK_XCLOSEIM=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_OPEN64=1 -DHAVE_LSEEK64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_STRUCT_TM_TM_ZONE=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1       -DTCL_SHLIB_EXT=\".so\"   /home/user/ns/ns-allinone-2.34/tcl8.4.18/unix/../generic/regcomp.c
make: gcc41-4.4: Command not found
make: *** [regcomp.o] Error 127
tcl8.4.18 make failed! Exiting ...
For problems with Tcl/Tk see http://www.scriptics.com
 
Old 03-31-2014, 04:48 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
# 5 .
Quote:
make: gcc41-4.4: Command not found
Quite obvious : You typed something completely wrong as "build commands".

? Which Ubuntu are you using now ?
Please show the outputs from these commands :
a) $ uname -m
b) $ cat /etc/issue

-
 
Old 03-31-2014, 08:29 PM   #7
sarf2k4
LQ Newbie
 
Registered: Mar 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
I ran the
sudo dpkg -i gcc41-compat-4.1.2.ubu1204_i386.deb g++41-compat-4.1.2_i386.deb
command based on the post #18 on the link you gave me,
rebooted and ran
cd ns-allinone-2.34/ && export CC=gcc41 CXX=g++41 && ./install

and got that error

The answer for that is:
a. i686
b. Ubuntu 12.04.4 LTS \n \l

Sorry to trouble you over such trivial matters
 
Old 04-01-2014, 03:01 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
The patch that works (with ns-2.32) is the ns-2.32-aodv-uu.patch,
from "aodv-uu-0.9.6.tar.gz".

Did you edit / port the changes to ns-2.34 ?
Which patch did you use ? ?

Post #1 : aodv-uu-0.9.5 has a patch for ns-2.29.3 !

-
 
  


Reply

Tags
segmentation fault ns2


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
NS2: Need of plain plain aodv.cc and aodv.h files chenil Linux - Software 1 07-10-2013 07:17 AM
ns2 segmentation fault when using energy model edsionwang Programming 0 04-27-2013 06:45 PM
A segmentation fault in NS2 kadij Linux - Newbie 0 06-14-2012 09:56 AM
Agentj and Ns2 Question Segmentation fault krabieh Linux - Newbie 0 10-11-2011 07:41 PM
ns2.34 Segmentation fault over Ubuntu 11.04 Amro1 Ubuntu 7 09-28-2011 09:24 AM


All times are GMT -5. The time now is 10:52 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