LinuxQuestions.org
Review your favorite Linux distribution.
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 01-26-2017, 04:25 PM   #1
baig7070
LQ Newbie
 
Registered: Nov 2016
Posts: 6

Rep: Reputation: Disabled
floating point exception error (core dumped)


This code was written with the intent to connect the mobile nodes(data collectors) with static nodes in a 2x4 grid.Now in this code, the value isn't divided by any zero value but still producing core dumped error.




set val(chan) Channel/WirelessChannel
set val(prop) Propagation/TwoRayGround
set val(netif) Phy/WirelessPhy
set val(ant) Antenna/OmniAntenna
set val(ifqlen) 50
set val(ifq) Queue/DropTail/PriQueue
set val(mac) Mac/802_11
set val(ll) LL
set val(rp) DSDV
set val(nn) 40
set val(mn) 8
set val(x) 1000
set val(y) 1000
set val(stop) 150
set num_row 4
#Define ns/nam standard trace
set ns_ [new Simulator]
set nf_ [open simple.tr w]
set namtrace [open simwrls.nam w]
set windowVsTime2 [open win.tr w]
$ns_ trace-all $nf_
$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
#creating topology
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
#create god nodes(shortest hops required to move rom one node to another)
create-god $val(nn)
#set chan_1_ [new $val(chan)]
#set chan_2_ [new $val(chan)]
#configuration of mobile nodes
$ns_ node-config -adhocRouting $val(rp)\
-llType $val(ll)\
-antType $val(ant)\
-macType $val(mac)\
-ifqType $val(ifq)\
-ifqLen $val(ifqlen)\
-propType $val(prop)\
-channelType $val(chan)\
-phyType $val(netif)\
-topoInstance $topo \
-macTrace OFF\
-agentTrace ON\
-routerTrace ON\
-movementTrace ON


# -channel $chan_1_
#creating static nodes in ns2
for {set i 8} {$i < $val(nn) } { incr i } {
set node($i) [$ns_ node]
}
#creating mobile node nodes in ns2
for {set i 0} {$i < $val(mn) } {incr i} {
set mobilenode_($i) [$ns_ node]
}
set k 0;
while {$k < 2 } {
for {set i 0} {$i < $num_row } {incr i} {
set m [expr $i+$k*$num_row];
$mobilenode_($m) set X_ [expr $i*240];
$mobilenode_($m) set Y_ [expr $k*480+480.0];
$mobilenode_($m) set Z_ 0.0
}
incr k;
}
#intial position of mobile nodes
#$node(0) set X_ 5.0
#$node(0) set Y_ 5.0
#$node(0) set Z_ 0.0

#$node(1) set X_ 245.0
#$node(1) set Y_ 380.0
#$node(1) set Z_ 0.0

#node(2) set X_ 140.0
#$node(2) set Y_ 256.0
#$node(2) set Z_ 0.0
#mobile sceneario Generator
$ns_ at 2.0 "$mobilenode_(0) setdest 150 150.0 3.0"
$ns_ at 4.0 "$mobilenode_(1) setdest 45 45.0 3.0"
$ns_ at 6.0 "$mobilenode_(2) setdest 250 250.0 3.0"
$ns_ at 8.0 "$mobilenode_(3) setdest 250 250.0 3.0"
$ns_ at 10.0 "$mobilenode_(4) setdest 250 250.0 3.0"
$ns_ at 12.0 "$mobilenode_(5) setdest 250 250.0 3.0"
$ns_ at 14.0 "$mobilenode_(6) setdest 250 250.0 3.0"
$ns_ at 16.0 "$mobilenode_(7) setdest 250 250.0 3.0"
#setting TCP connection between sensornodes and mobilenode(0)
#setting FTP on TCP connection
set tcp [new Agent/TCP/Newreno]
$tcp set class_ 2
#set sink [new Agent/TCPSink]
set sink_(0) [new Agent/TCPSink]
$ns_ attach-agent $node(8) $tcp
$ns_ attach-agent $node(8) $sink_(0)
$ns_ connect $tcp $sink_(0)
set ftp_(0) [new Application/FTP]
$ftp_(0) attach-agent $tcp
$ns_ at 10.0 "$ftp_(0) start"
#set sink [new Agent/TCPSink]
set sink_(0) [new Agent/TCPSink]
$ns_ attach-agent $node(9) $tcp
$ns_ attach-agent $node(9) $sink_(0)
$ns_ connect $tcp $sink_(0)
set ftp_(0) [new Application/FTP]
$ftp_(0) attach-agent $tcp
$ns_ at 10.0 "$ftp_(0) start"
#set sink [new Agent/TCPSink]
set sink_(0) [new Agent/TCPSink]
$ns_ attach-agent $node(10) $tcp
$ns_ attach-agent $node(10) $sink_(0)
$ns_ connect $tcp $sink_(0)
set ftp_(0) [new Application/FTP]
$ftp_(0) attach-agent $tcp
$ns_ at 10.0 "$ftp_(0) start"
#set sink [new Agent/TCPSink]
set sink_(0) [new Agent/TCPSink]
$ns_ attach-agent $node(11) $tcp
$ns_ attach-agent $node(11) $sink_(0)
$ns_ connect $tcp $sink_(0)
set ftp_(0) [new Application/FTP]
$ftp_(0) attach-agent $tcp
$ns_ at 10.0 "$ftp_(0) start"
#set sink [new Agent/TCPSink]
set sink_(0) [new Agent/TCPSink]
$ns_ attach-agent $node(12) $tcp
$ns_ attach-agent $node(12) $sink_(0)
$ns_ connect $tcp $sink_(0)
set ftp_(0) [new Application/FTP]
$ftp_(0) attach-agent $tcp
$ns_ at 10.0 "$ftp_(0) start"
#set sink [new Agent/TCPSink]
set sink_(0) [new Agent/TCPSink]
$ns_ attach-agent $node(13) $tcp
$ns_ attach-agent $node(13) $sink_(0)
$ns_ connect $tcp $sink_(0)
set ftp_(0) [new Application/FTP]
$ftp_(0) attach-agent $tcp
$ns_ at 10.0 "$ftp_(0) start"
#window size
proc plotWindow {tcpSource file} {
global ns_
set time 0.01
set now [$ns_ now]
set cwnd [$tcpSource set cwnd_]
puts $file "$now $cwnd"
$ns_ at [expr $now+$time] "plotWindow $tcpSource $file" }
$ns_ at 10.1 "plotWindow $tcp $windowVsTime2"
#defining node position at nam file
for {set i 8} {$i < $val(nn)} {incr i} {
$ns_ initial_node_pos $node($i) 30;
}
for {set i 0} {$i < $val(mn) } {incr i} {
$ns_ initial_node_pos $mobilenode_($i) 60;
}
#Total time of simulation
for {set i 8} {$i < $val(nn) } {incr i} {
$ns_ at $val(stop) "$node($i) reset";
}
#ending nam and simulation

for {set i 0} {$i < $val(mn) } {incr i} {
$ns_ at $val(stop) "$mobilenode_($i) reset";
}
$ns_ at $val(stop)"ns_ stop";
$ns_ at $val(stop) "$ns_ nam-end-wireless $val(stop)"
$ns_ at $val(stop) "stop"
$ns_ at 100.01 "puts "end simulation" ; $ns_ halt"
#stop procedure
proc stop {} {
global ns_ nf_ namtrace
$ns_ flush-trace
close $nf_
close $namtrace
}
$ns_ run
 
Old 01-26-2017, 05:21 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,318

Rep: Reputation: 6019Reputation: 6019Reputation: 6019Reputation: 6019Reputation: 6019Reputation: 6019Reputation: 6019Reputation: 6019Reputation: 6019Reputation: 6019Reputation: 6019
Quote:
Originally Posted by baig7070 View Post
This code was written with the intent to connect the mobile nodes(data collectors) with static nodes in a 2x4 grid.Now in this code, the value isn't divided by any zero value but still producing core dumped error.
Code:
set val(chan) Channel/WirelessChannel
set val(prop) Propagation/TwoRayGround
set val(netif) Phy/WirelessPhy
set val(ant) Antenna/OmniAntenna
set val(ifqlen) 50
set val(ifq) Queue/DropTail/PriQueue
set val(mac) Mac/802_11
set val(ll) LL
set val(rp) DSDV
set val(nn) 40
set val(mn) 8
set val(x) 1000
set val(y) 1000
set val(stop) 150
set num_row 4
#Define ns/nam standard trace
set ns_ [new Simulator]
set nf_ [open simple.tr w]
set namtrace [open simwrls.nam w]
set windowVsTime2 [open win.tr w]
$ns_ trace-all $nf_
$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
#creating topology
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
#create god nodes(shortest hops required to move rom one node to another)
create-god $val(nn)
#set chan_1_ [new $val(chan)]
#set chan_2_ [new $val(chan)]
#configuration of mobile nodes
$ns_ node-config -adhocRouting $val(rp)\
   -llType $val(ll)\
   -antType $val(ant)\
   -macType $val(mac)\
   -ifqType $val(ifq)\
   -ifqLen $val(ifqlen)\
   -propType $val(prop)\
   -channelType $val(chan)\
   -phyType $val(netif)\
   -topoInstance $topo \
   -macTrace OFF\
   -agentTrace ON\
   -routerTrace ON\
   -movementTrace  ON


 #  -channel $chan_1_     
#creating static nodes in ns2
for {set i 8} {$i < $val(nn) } { incr i } {
set node($i) [$ns_ node]
}
#creating mobile node nodes in ns2
for {set i 0} {$i < $val(mn) } {incr i} {
    set mobilenode_($i) [$ns_ node]
}
set k 0;
while {$k < 2 } {
    for {set i 0} {$i < $num_row } {incr i} {
 set m [expr $i+$k*$num_row];
 $mobilenode_($m) set X_ [expr $i*240];
 $mobilenode_($m) set Y_ [expr $k*480+480.0];
 $mobilenode_($m) set Z_ 0.0
    }
    incr k;
}
#intial position of mobile nodes
#$node(0) set X_ 5.0
#$node(0) set Y_ 5.0
#$node(0) set Z_ 0.0

#$node(1) set X_ 245.0
#$node(1) set Y_ 380.0
#$node(1) set Z_ 0.0

#node(2) set X_ 140.0
#$node(2) set Y_ 256.0
#$node(2) set Z_ 0.0
#mobile sceneario Generator
$ns_ at 2.0 "$mobilenode_(0) setdest 150 150.0 3.0"
$ns_ at 4.0 "$mobilenode_(1) setdest 45 45.0 3.0"
$ns_ at 6.0 "$mobilenode_(2) setdest 250 250.0 3.0"
$ns_ at 8.0 "$mobilenode_(3) setdest 250 250.0 3.0"
$ns_ at 10.0 "$mobilenode_(4) setdest 250 250.0 3.0"
$ns_ at 12.0 "$mobilenode_(5) setdest 250 250.0 3.0"
$ns_ at 14.0 "$mobilenode_(6) setdest 250 250.0 3.0"
$ns_ at 16.0 "$mobilenode_(7) setdest 250 250.0 3.0"
#setting TCP connection between sensornodes and mobilenode(0)
#setting FTP on TCP connection
set tcp [new Agent/TCP/Newreno]
$tcp set class_ 2
#set sink [new Agent/TCPSink]
set sink_(0) [new Agent/TCPSink]
$ns_ attach-agent $node(8) $tcp
$ns_ attach-agent $node(8) $sink_(0)
$ns_ connect $tcp $sink_(0)
set ftp_(0) [new Application/FTP]
$ftp_(0) attach-agent $tcp
$ns_ at 10.0 "$ftp_(0) start" 
 #set sink [new Agent/TCPSink]
set sink_(0) [new Agent/TCPSink]
$ns_ attach-agent $node(9) $tcp
$ns_ attach-agent $node(9) $sink_(0)
$ns_ connect $tcp $sink_(0)
set ftp_(0) [new Application/FTP]
$ftp_(0) attach-agent $tcp
$ns_ at 10.0 "$ftp_(0) start"
 #set sink [new Agent/TCPSink]
set sink_(0) [new Agent/TCPSink]
$ns_ attach-agent $node(10) $tcp
$ns_ attach-agent $node(10) $sink_(0)
$ns_ connect $tcp $sink_(0)
set ftp_(0) [new Application/FTP]
$ftp_(0) attach-agent $tcp
$ns_ at 10.0 "$ftp_(0) start"
 #set sink [new Agent/TCPSink]
set sink_(0) [new Agent/TCPSink]
$ns_ attach-agent $node(11) $tcp
$ns_ attach-agent $node(11) $sink_(0)
$ns_ connect $tcp $sink_(0)
set ftp_(0) [new Application/FTP]
$ftp_(0) attach-agent $tcp
$ns_ at 10.0 "$ftp_(0) start"
  #set sink [new Agent/TCPSink]
set sink_(0) [new Agent/TCPSink]
$ns_ attach-agent $node(12) $tcp
$ns_ attach-agent $node(12) $sink_(0)
$ns_ connect $tcp $sink_(0)
set ftp_(0) [new Application/FTP]
$ftp_(0) attach-agent $tcp
$ns_ at 10.0 "$ftp_(0) start"
 #set sink [new Agent/TCPSink]
set sink_(0) [new Agent/TCPSink]
$ns_ attach-agent $node(13) $tcp
$ns_ attach-agent $node(13) $sink_(0)
$ns_ connect $tcp $sink_(0)
set ftp_(0) [new Application/FTP]
$ftp_(0) attach-agent $tcp
$ns_ at 10.0 "$ftp_(0) start"
#window size
proc plotWindow {tcpSource file} {
global ns_
set time 0.01
set now [$ns_ now]
set cwnd [$tcpSource set cwnd_]
puts $file "$now $cwnd"
$ns_ at [expr $now+$time] "plotWindow $tcpSource $file" }
$ns_ at 10.1 "plotWindow $tcp $windowVsTime2"
#defining node position at nam file
for {set i 8} {$i < $val(nn)} {incr i} {
$ns_ initial_node_pos $node($i) 30;
}
for {set i 0} {$i < $val(mn) } {incr i} {
$ns_ initial_node_pos $mobilenode_($i) 60;
}
 #Total time of simulation
for {set i 8} {$i < $val(nn) } {incr i} {
$ns_ at $val(stop) "$node($i) reset";
}
#ending nam and simulation

for {set i 0} {$i < $val(mn) } {incr i} {
$ns_ at $val(stop) "$mobilenode_($i) reset";
}
$ns_ at $val(stop)"ns_ stop";
$ns_ at $val(stop) "$ns_ nam-end-wireless $val(stop)"
$ns_ at $val(stop) "stop"
$ns_ at 100.01 "puts "end simulation" ; $ns_ halt"
#stop procedure
proc stop {} {
global ns_ nf_ namtrace
$ns_ flush-trace
close $nf_
close $namtrace
}
$ns_ run
You were told in your previous thread to provide details, and show what you've done to resolve your problem. Just telling us "produced core dump error" tells us absolutely NOTHING that will help us to help you. Read the "Question Guidelines" link in my posting signature. And when posting code, you need to put it in CODE blocks.

You need to provide version/distro of Linux, where this code is actually running, with what compiler, what the EXACT error(s)/message(s) you get are, what you do to get them, etc. We aren't going to write and debug your code for you...show your efforts and provide details, and we will be happy to help.
 
Old 01-26-2017, 06:01 PM   #3
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
baig7070: Since you seem UNwilling/UNable to read links provided in prior threads,
here is a copy of the information in the link, to which #2 correctly referred:
(note: the red/underlining is mine; the text is an exact copy&paste)

You were pointed here because a fellow LQ member feels the thread you started doesn't contain enough information to enable us to help you. We understand that Linux can be intimidating for new members, and we really do want to help. That said, please understand that LQ is not a help desk, customer service line for a product you purchased or willing to do your homework (although we are happy to assist you with specifics, if you show some effort of your own!). We're a 100% volunteer organization that wants to help you help yourself.

Here are a couple tips that will enable us to help you moving forward:

When asking a question, be sure to provide as many relevant details as possible. You should include the distribution and version you're using, along with hardware details, application version and exact error messages where applicable.
Using a descriptive title will vastly increase the number of members who see your thread, and therefore make a response significantly more likely.
If you're actively troubleshooting an issue you should also include any steps you've already taken.
You may want to include how what you are experiencing differs from what you expected to experience.
Before posting, have you used the search function to ensure your question hasn't been asked before?
You can edit your post by clicking the EDIT button in the bottom right corner of your message.

If you are unwilling or unable to ask questions in a manner that allows us to help you, it's unlikely our community will be able to provide you a solution. Unfortunately, serial offenders who show wanton disregard for this request after multiple pointers may be asked to seek help elsewhere. We truly hope that isn't necessary, and assure you Linux and Open Source are extremely rewarding and well worth the learning curve in the long run.

Last edited by Jjanel; 01-26-2017 at 08:40 PM.
 
Old 01-27-2017, 07:32 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,432
Blog Entries: 13

Rep: Reputation: 3744Reputation: 3744Reputation: 3744Reputation: 3744Reputation: 3744Reputation: 3744Reputation: 3744Reputation: 3744Reputation: 3744Reputation: 3744Reputation: 3744
Hi baig7070,

Once again welcome to LQ.

Please note that your two other threads are very similar to the respect that they do not provide details about what you are trying to do to diagnose your problems, but instead asking others to perform work on your behalf to solve these questions or problems:

http://www.linuxquestions.org/questi...7/#post5646865
http://www.linuxquestions.org/questi...3/#post5650177

This is not how the LQ site works. Advice givers here are volunteers who have chosen to help you learn further about Linux and Linux related topics.

You've shown your code and indicated that it resulted in a core dump. Have you tried to look at the core dump? Have you tried to debug your code? For instance, your code sets up a lot of variables, and then starts some ns library calls. Perhaps you can exit your code, or debug it and stop it just after the initialization and verify that all is well and the situation is as expected before continuing to debug.

Note that one way to do this is to compartmentalize the code into functions or areas of known working sections at the very least so that you understand what works up to this point.

Rather than restart with another new question, please respond in this thread with some further details.
 
2 members found this post helpful.
  


Reply

Tags
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
Floating Point Exception (Core Dumped) sreehk Linux - Newbie 3 01-22-2016 04:28 AM
Evalvid ns2.35: error Floating point exception (core dumped) hbenlabbes Linux - Software 1 11-14-2015 01:53 PM
Floating point exception (core dumped) getting this error while running zishan.tcl Md Zishan Khan Linux - Networking 1 05-11-2015 05:20 PM
floating point exception (core dumped) aicaicai Linux - Newbie 2 05-10-2013 08:35 AM
firefox 2.0 Floating Point Exception (core dumped) error on Ubuntu 6.10 maximum Ubuntu 1 12-28-2006 12:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:37 AM.

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