LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 09-24-2011, 03:01 PM   #1
Amro1
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Rep: Reputation: Disabled
Question ns2.34 Segmentation fault over Ubuntu 11.04


Hi folks,

I have Ubuntu 11.04 and installed ns2.34.

After some trials and tweaking, I have a successful ns2 installation but when typing ns in the bash, I get ''Segmentation fault''.

Also I tried to validate the installation and it gave me so many errors!

notice that I have replaced the directories TCL, OTCL, TK and TCLCL in in ns2.34 by the ones in ns2.35

Last line result:

amro@mohammadamro:~/simu/ns2.34-eurane-svn$ ns
Segmentation fault

Any idea is appreciated...

Details:
-------------------------------------------------------------------------------
--------------------------------------------------------------------------------

Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.5.8: /home/amro/simu/ns2.34-eurane-svn/{bin,include,lib}
tk8.5.8: /home/amro/simu/ns2.34-eurane-svn/{bin,include,lib}
otcl: /home/amro/simu/ns2.34-eurane-svn/otcl-1.14
tclcl: /home/amro/simu/ns2.34-eurane-svn/tclcl-1.20
ns: /home/amro/simu/ns2.34-eurane-svn/ns-2.34/ns
nam: /home/amro/simu/ns2.34-eurane-svn/nam-1.14/nam
gt-itm: /home/amro/simu/ns2.34-eurane-svn/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns

----------------------------------------------------------------------------------

Please put /home/amro/simu/ns2.34-eurane-svn/bin:/home/amro/simu/ns2.34-eurane-svn/tcl8.5.8/unix:/home/amro/simu/ns2.34-eurane-svn/tk8.5.8/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.

IMPORTANT NOTICES:

(1) You MUST put /home/amro/simu/ns2.34-eurane-svn/otcl-1.14, /home/amro/simu/ns2.34-eurane-svn/lib,
into your LD_LIBRARY_PATH environment variable.
If it complains about X libraries, add path to your X libraries
into LD_LIBRARY_PATH.
If you are using csh, you can set it like:
setenv LD_LIBRARY_PATH <paths>
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=<paths>

(2) You MUST put /home/amro/simu/ns2.34-eurane-svn/tcl8.5.8/library into your TCL_LIBRARY environmental
variable. Otherwise ns/nam will complain during startup.

After these steps, you can now run the ns validation suite with
cd ns-2.34; ./validate

For trouble shooting, please first read ns problems page
http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
for related posts.

amro@mohammadamro:~/simu/ns2.34-eurane-svn$ ns
Segmentation fault
 
Old 09-24-2011, 06:02 PM   #2
corp769
Guru
 
Registered: Apr 2005
Posts: 5,807

Rep: Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996
Hello,

Getting "Segmentation Fault" tells us that it doesn't work, but it's not enough for debugging. Can you try running ns2 with gdb and post the output you get?

Cheers,

Josh
 
Old 09-25-2011, 01:44 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,543

Rep: Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509
Welcome to LQ.
Quote:
.. I have replaced the directories TCL, OTCL, TK and TCLCL
in in ns2.34 by the ones in ns2.35
Not expected to work. (But then again: I don't think I ever
tested such a modification : May work in some way.)
(That's what we do for ns-allinone-2.27: Use tcl tk otcl tclcl
from ns-allinone-2.34 ).

The 32bits Ubuntu 11.04 can be used for some ns-allinone-2.xx.
The 64bits Ubuntu 11.04 : No.

Build procedure :
cd ns-allinone-2.34/ && export CC=gcc42 CXX=g++42 && ./install

Downloading the "gcc42-compat-4.2.4_i386.deb" package :
https://docs.google.com/uc?id=0B7S25...nload&hl=en_US
And "g++42-compat-4.2.4_i386.deb" :
https://docs.google.com/uc?id=0B7S25...nload&hl=en_US

Install the packages with :
sudo dpkg -i gcc42-compat-4.2.4_i386.deb g++42-compat-4.2.4_i386.deb
Then reboot, and the new "compat" compilers can be used.

..

Last edited by knudfl; 09-25-2011 at 01:37 PM.
 
Old 09-25-2011, 06:31 AM   #4
Amro1
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
debug. ns2 under Ubnuntu 11.04

Quote:
Originally Posted by corp769 View Post
Hello,

Getting "Segmentation Fault" tells us that it doesn't work, but it's not enough for debugging. Can you try running ns2 with gdb and post the output you get?

Cheers,

Josh
Hi Josh,

Thanks for your reply.

Here is the debug. result:

amro@mohammadamro:~/simu/ns2.34-eurane-svn$ gdb ns
GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/amro/simu/ns2.34-eurane-svn/bin/ns...done.
(gdb) run
Starting program: /home/amro/simu/ns2.34-eurane-svn/bin/ns
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x0000000000860911 in OTclODestroyMethod (cd=<value optimized out>, in=0xd29f10, argc=4, argv=0x7fffffffb000) at otcl.c:1305
1305 CONST84 char* name = Tcl_VarHashGetKey(ObjVarTablePtr(obj), hp);
(gdb)

Is this enough or I have to go on .... I am just a beginner in Linux and ns2... thanks for help
 
Old 09-25-2011, 06:38 AM   #5
Amro1
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
but I am using Ubuntu 11.04 to install ns2.34 over 64bit CPU

Quote:
Originally Posted by knudfl View Post
Welcome to LQ.

Not expected to work. (But then again: I don't think I ever
tested such a modification : May work in some way.)
(That's what we do for ns-allinone-2.27: Use tcl tk otcl tclcl
from ns-allinone-2.34 ).

The 32bits Ubuntu 11.04 can be used for ns-allinone-2.xx.
The 64bits Ubuntu 11.04 : No.

Build procedure :
cd ns-allinone-2.34/ && export CC=gcc42 CXX=g++42 && ./install

Downloading the "gcc42-compat-4.2.4_i386.deb" package :
https://docs.google.com/uc?id=0B7S25...nload&hl=en_US
And "g++42-compat-4.2.4_i386.deb" :
https://docs.google.com/uc?id=0B7S25...nload&hl=en_US

Install the packages with :
sudo dpkg -i gcc42-compat-4.2.4_i386.deb g++42-compat-4.2.4_i386.deb
Then reboot, and the new "compat" compilers can be used.

..

Hello knudfl,

Thanks for your reply and welcoming. May be here is the trick. I am using 64 bit based CPU. I was not aware or told that Ubuntu 11.04 can't install ns2 under64 bit. Any elaboration or explanation is appreciated.

BR,
Amro
 
Old 09-25-2011, 01:35 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,543

Rep: Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509Reputation: 2509
Quote:
I am using 64 bit based CPU
The CPU can be '64bits', but the OS must be 32bits, if Ubuntu 11.04.

Well, at least that's how things worked until this month.
Some updates can have changed Ubuntu 11.04 :
Now the gcc/g++ 4.2.4 works. It used to be version 3.4.6 for
the combination ns-2.34 / Ubuntu 11.04.
The ealier errors for the 64bits OS was "ns buffer overflow".
Now it may be 'Segmentation fault' ?
http://www.linuxquestions.org/questi...04-a-899963/#2
In the linked thread you can also read about "Erlend's porting to gcc4.5".
( I haven't tested the "Erlend modifications". May work.)


Currently I have no working 64bits Ubuntu 11.04, so I made a test
compile on the similar Debian Wheezy :
gcc/g++-4.6 for tcl tk otcl tclcl, and g++ 3.4.6 for ns-2.34: OK.
No errors by running the 64bits binary 'ns'.
Conclusion : Ubuntu 11.04 is not the best choice for ns-allinone-2.34.
Any other OS should be preferred ( Ubuntu 10.04, 10.10 can be used.)
NS-2.34 : Originally built and tested on the 32bits CentOS 5.

Generally for all OS :
Ns2 is built for a 32bits OS, not all tests will pass if it's a 64bits OS.

..

Last edited by knudfl; 09-25-2011 at 01:42 PM.
 
Old 09-25-2011, 02:53 PM   #7
Amro1
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Yes it is a 64 bit Kernel ... next ?

Quote:
Originally Posted by knudfl View Post
The CPU can be '64bits', but the OS must be 32bits, if Ubuntu 11.04.

Well, at least that's how things worked until this month.
Some updates can have changed Ubuntu 11.04 :
Now the gcc/g++ 4.2.4 works. It used to be version 3.4.6 for
the combination ns-2.34 / Ubuntu 11.04.
The ealier errors for the 64bits OS was "ns buffer overflow".
Now it may be 'Segmentation fault' ?
http://www.linuxquestions.org/questi...04-a-899963/#2
In the linked thread you can also read about "Erlend's porting to gcc4.5".
( I haven't tested the "Erlend modifications". May work.)


Currently I have no working 64bits Ubuntu 11.04, so I made a test
compile on the similar Debian Wheezy :
gcc/g++-4.6 for tcl tk otcl tclcl, and g++ 3.4.6 for ns-2.34: OK.
No errors by running the 64bits binary 'ns'.
Conclusion : Ubuntu 11.04 is not the best choice for ns-allinone-2.34.
Any other OS should be preferred ( Ubuntu 10.04, 10.10 can be used.)
NS-2.34 : Originally built and tested on the 32bits CentOS 5.

Generally for all OS :
Ns2 is built for a 32bits OS, not all tests will pass if it's a 64bits OS.

..

Well ... I confirm my Ubuntu 11.04 is 64bit ...

amro@mohammadamro:~$ uname -m
x86_64

As mentioned in my first post that after tweaking and trails I managed to install ns2.34 successfully that was based mainly on Erlend's postings to overcome the buffer overflow problem... Now after it was solved the segmentation fault showed up and I posted here...

I also ran a validate after the so called ''successful installation'' and many many errors showed up! after that typing ns and ending with the segmentation fault ... and debugging showed an issue in one Otcl line, does the gcc complier version play a role over here, i.e. g++ 4.5?

Thanks again knudfl .. It seems asper your suggestion and conclusion I've to go with other Ubuntu or Linux. other posts are all apprecaited.
 
Old 09-28-2011, 08:24 AM   #8
Amro1
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
ns2.35 can work under Ubuntu 64bit if installed via Synaptic Package Manager

Quote:
Originally Posted by Amro1 View Post
Hi folks,

I have Ubuntu 11.04 and installed ns2.34.

After some trials and tweaking, I have a successful ns2 installation but when typing ns in the bash, I get ''Segmentation fault''.

Also I tried to validate the installation and it gave me so many errors!

notice that I have replaced the directories TCL, OTCL, TK and TCLCL in in ns2.34 by the ones in ns2.35

Last line result:

amro@mohammadamro:~/simu/ns2.34-eurane-svn$ ns
Segmentation fault

Any idea is appreciated...

Details:
-------------------------------------------------------------------------------
--------------------------------------------------------------------------------

Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.5.8: /home/amro/simu/ns2.34-eurane-svn/{bin,include,lib}
tk8.5.8: /home/amro/simu/ns2.34-eurane-svn/{bin,include,lib}
otcl: /home/amro/simu/ns2.34-eurane-svn/otcl-1.14
tclcl: /home/amro/simu/ns2.34-eurane-svn/tclcl-1.20
ns: /home/amro/simu/ns2.34-eurane-svn/ns-2.34/ns
nam: /home/amro/simu/ns2.34-eurane-svn/nam-1.14/nam
gt-itm: /home/amro/simu/ns2.34-eurane-svn/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns

----------------------------------------------------------------------------------

Please put /home/amro/simu/ns2.34-eurane-svn/bin:/home/amro/simu/ns2.34-eurane-svn/tcl8.5.8/unix:/home/amro/simu/ns2.34-eurane-svn/tk8.5.8/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.

IMPORTANT NOTICES:

(1) You MUST put /home/amro/simu/ns2.34-eurane-svn/otcl-1.14, /home/amro/simu/ns2.34-eurane-svn/lib,
into your LD_LIBRARY_PATH environment variable.
If it complains about X libraries, add path to your X libraries
into LD_LIBRARY_PATH.
If you are using csh, you can set it like:
setenv LD_LIBRARY_PATH <paths>
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=<paths>

(2) You MUST put /home/amro/simu/ns2.34-eurane-svn/tcl8.5.8/library into your TCL_LIBRARY environmental
variable. Otherwise ns/nam will complain during startup.

After these steps, you can now run the ns validation suite with
cd ns-2.34; ./validate

For trouble shooting, please first read ns problems page
http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
for related posts.

amro@mohammadamro:~/simu/ns2.34-eurane-svn$ ns
Segmentation fault
Hi again,

Just to update ...

An update is: ns2.35 can work under Ubuntu 64bit (in my case) if installed via Synaptic Package Manager ... but the thing is that I can not modify the package or configure ns2 to work with an IDE (e.g. Eclipse)...

BR,
MAMRO
 
  


Reply


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
Ubuntu - quotaon: segmentation fault brgsousa Linux - Software 1 01-27-2011 05:25 PM
Anacron email - Segmentation Fault - Ubuntu devnull10 Linux - Software 5 12-13-2010 04:54 PM
Segmentation fault over UBUNTU SERVER Freeck Linux - Server 3 02-22-2009 09:08 AM
ubuntu & firefox - segmentation fault SyCo123 Linux - General 1 07-22-2008 07:49 AM
[ubuntu] [7.10] Xsane gives Segmentation fault (core dumped) linkmaster03 Linux - Software 4 04-27-2008 09:48 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration