LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (http://www.linuxquestions.org/questions/ubuntu-63/)
-   -   ns2.34 Segmentation fault over Ubuntu 11.04 (http://www.linuxquestions.org/questions/ubuntu-63/ns2-34-segmentation-fault-over-ubuntu-11-04-a-904827/)

Amro1 09-24-2011 03:01 PM

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

corp769 09-24-2011 06:02 PM

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

knudfl 09-25-2011 01:44 AM

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.

..

Amro1 09-25-2011 06:31 AM

debug. ns2 under Ubnuntu 11.04
 
Quote:

Originally Posted by corp769 (Post 4481382)
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

Amro1 09-25-2011 06:38 AM

but I am using Ubuntu 11.04 to install ns2.34 over 64bit CPU
 
Quote:

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

knudfl 09-25-2011 01:35 PM

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.

..

Amro1 09-25-2011 02:53 PM

Yes it is a 64 bit Kernel ... next ?
 
Quote:

Originally Posted by knudfl (Post 4481900)
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.

Amro1 09-28-2011 08:24 AM

ns2.35 can work under Ubuntu 64bit if installed via Synaptic Package Manager
 
Quote:

Originally Posted by Amro1 (Post 4481285)
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


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