Segmentation fault when launching nam executable

Bug #1376970 reported by Paul Kilgo
40
This bug affects 9 people
Affects Status Importance Assigned to Milestone
nam (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

Any time I try to run the nam executable I get a segmentation fault:

$> nam
Segmentation fault (core dumped)

$> nam nam.out
Segmentation fault (core dumped)

I tried to get a backtrace in gdb. Seems to be problem in the Tk initialization routines:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff77504ba in Tk_PkgInitStubsCheck () from /usr/lib/x86_64-linux-gnu/libtk8.6.so
(gdb) bt
#0 0x00007ffff77504ba in Tk_PkgInitStubsCheck () from /usr/lib/x86_64-linux-gnu/libtk8.6.so
#1 0x0000000000417981 in main ()

My libtk8.6 version is 8.6.1-3ubuntu2. I was able able to reproduce this problem compiling against libtk8.6 using a simple program mirroring the way it is done in nam's main.cc:

#include <tk.h>

int main() {
  Tcl_Interp *interp = Tcl_CreateInterp();
  Tcl_InitStubs(interp, "8.1", 0);
  Tk_InitStubs(interp, "8.1", 0);
  return 0;
}

I'm not familiar with libtk at all so I have no idea if that is proper usage.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: nam 1.15-3
ProcVersionSignature: Ubuntu 3.13.0-24.47-generic 3.13.9
Uname: Linux 3.13.0-24-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.4
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Oct 2 20:39:12 2014
InstallationDate: Installed on 2012-11-28 (673 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
SourcePackage: nam
UpgradeStatus: Upgraded to trusty on 2014-05-16 (139 days ago)

Revision history for this message
Paul Kilgo (paulkilgo) wrote :
Revision history for this message
deepthi (deepthianandv) wrote :

Hiii,
I have installed ns2.35 on ubunt 14.04
Even i am facing the similar issue,

Any time I try to run the nam executable I get a segmentation fault:

$> nam
Segmentation fault (core dumped)

is the isue solved for you now..?
if yes can u please share the details on the same..

Thanks.

Revision history for this message
Paul Kilgo (paulkilgo) wrote :

This issue still persists for me. If this affects you then you should mark it so at the top of the bug report's page.

In the mean time I have checked if the same problem is in Debian sid. The segfault is not there (it does fail for another reason but it did not seem related to this issue). This and the backtrace I posted in my last comment makes me think this could be due to a change in tcl8.6.

Revision history for this message
deepthi (deepthianandv) wrote :

i found the below solution in one of the blog for the segmentaion fault issue,
-----------------------------------

You can try this

1. Update your nam version
$ sudo apt-get install --reinstall nam libotcl1 libtclcl1

if it still shows error please follow following steps:

a) Delete the nam-1.15/ folder and any other / folder.
b) $ sudo apt-get remove nam

download the following nam and install
https://drive.google.com/file/d/0B7S255p3kFXNUkx0LVU1NnFVQTA/view
-------------------------
i have downloaded nam-1.15-10 from the link given
but i am not sure of how to install it..
if u figure it out pls let me know..

Revision history for this message
Connor Imes (ckimes) wrote :

Thanks for the report, it looks like others have also experienced this elsewhere:
http://askubuntu.com/questions/468790/nam-installation-problem-in-ns2-segmentation-fault
http://askubuntu.com/questions/467901/segmentation-fault-core-dumped-in-ns2-ubuntu-14-04
http://ubuntuforums.org/showthread.php?t=2251137

The backtrace looks sufficient to mark this bug as Triaged since we can see the function names.
Line numbers would be preferable to addresses - you should be able to get these by installing the dbg packages for the affected libraries and capturing a new trace.

Changed in nam (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Paul Kilgo (paulkilgo) wrote :

OK, here is the updated backtrace with nam-dbg and libtk8.6-dbg installed:

#0 0x00007ffff77504ba in Tk_PkgInitStubsCheck (interp=0x6a4340,
    version=0x448b8b "8.1", exact=0)
    at /build/buildd/tk8.6-8.6.1/unix/../generic/tkWindow.c:3400
#1 0x0000000000417981 in main (argc=1, argv=0x7fffffffdea8)
    at /build/buildd/nam-1.15/main.cc:334

Revision history for this message
Shin Darth (shin-darth) wrote :

Confirmed, I get segmentation fault each time I try to run nam on Ubuntu 14.04

Revision history for this message
Darshan (darshannaik007) wrote :

Watch this video to solve the segmentation fault error in ns2 https://www.youtube.com/watch?v=GtkskqH1NHo

Revision history for this message
Darshan (darshannaik007) wrote :

use this link to solve the error https://youtu.be/TY7TcHRleqQ

Revision history for this message
gautam sahu (gautam30) wrote :

How to Install NS-2.35 in Ubuntu- 15.10 / 16.04 Step-by-Step

Refer : https://youtu.be/c5zjM5d7hMI
OR https://www.youtube.com/watch?v=c5zjM5d7hMI&t=6s

Install NS2

 First, check that the universe repository is enabled by inspecting '/etc/apt/sources.list' with your favourite editor. You will need to use sudo to ensure that you have permissions to edit the file.
1.) sudo gedit /etc/apt/sources.list
 If universe is not included then modify the file so that it does.
2.) deb http://us.archive.ubuntu.com/ubuntu wily main universe
 After any changes you should run this command to update your system.
3.) sudo apt-get update
4.) sudo apt-get install ns2

Install Nam
5.) sudo apt-get purge nam
6.) wget --user-agent="Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" "http://technobytz.com/wp-content/uploads/2015/11/nam_1.14_amd64.zip"
7.) unzip nam_1.14_amd64.zip
8.) sudo dpkg -i nam_1.14_amd64.deb
9.) sudo apt-mark hold nam

If you are facing problem for nam then follow step from 5 to on-words.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.