A problem with "terminated with signal SIGFPE"

693 views
Skip to first unread message

Me Sa

unread,
Oct 3, 2014, 10:31:16 AM10/3/14
to ns-3-...@googlegroups.com
hello guys
I've ran the attached code and I have a problem with this code as follow:
"Command ['/home/me/Desktop/ns20/ns-3.20/build/scratch/l2'] terminated with signal SIGFPE. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>")."

this error has happened between Line 317 and 320 the attached code.
what should I do or what should I change in my code?
can anyone help me?


2.cc

Nat P

unread,
Oct 3, 2014, 10:40:43 AM10/3/14
to ns-3-...@googlegroups.com

iCount is going over the vector's bound. Your code has a bug.. run it in a debugger and see what's happening.

Konstantinos

unread,
Oct 3, 2014, 10:50:42 AM10/3/14
to ns-3-...@googlegroups.com
Hi,

 For example, if a process attempted integer divide by zero on an x86 CPU, a divide errorexception would be generated and cause the kernel to send the SIGFPE signal to the process.

which means you are dividing with zero:
meanDlDelayMatrix[iCount] = stats->second.delaySum.GetSeconds()/stats->second.rxPackets;
packetLossRatioMatrix
[iCount++] = stats->second.lostPackets / (stats->second.lostPackets + stats->second.rxPackets);    

Perhaps your RxPackets or Lost+RxPackets are zero...

Me Sa

unread,
Oct 3, 2014, 11:13:12 AM10/3/14
to ns-3-...@googlegroups.com
thanks so much for reply.
you are right, Konstantinos
I checked it and found that "Rx Packets = 0"
but i am confused why its Zero.
Flow ID: 7 ; 1.0.0.2 -----> 7.0.0.2
Tx Packets = 100
Rx Packets = 0
Duration: -0.00653934
Last Received Packet: 0 Seconds ---->Throughput: -0 Kbps
so what do I change?



Konstantinos

unread,
Oct 3, 2014, 11:24:07 AM10/3/14
to ns-3-...@googlegroups.com
Why is it zero? Because no packets were received during that period. 
In your code you periodically check throughput (every 1 sec). It could be that for a particular second the throughout of the particular flow you monitor is zero, for any reason (collisions, no traffic, scheduler etc).

What to change? Nothing in terms of why it is zero, but you should add checks so that you do not division with zero. 
Also, I would recommend checking your calculations, duration negative? 

Me Sa

unread,
Oct 3, 2014, 11:35:40 AM10/3/14
to ns-3-...@googlegroups.com
thanks Konstantinos for reply again, I will try...

Me Sa

unread,
Oct 5, 2014, 10:34:24 AM10/5/14
to ns-3-...@googlegroups.com
hello Konstantinos
I
solved the problem with sum
(Rx Packets + 1) in lines 320 and 321 my code( is that right?); but the problem that I has confused why Throughput and Rx Packet are zero in all steps!!! the output has attached.
may you test my code for a moment?

the second problem that I had is about output png and plt file. how can I get them and see them as a figure. should I enable a option in ./waf or ./build command? if yes please explain it. otherwise what should I do?
best regards and thanks for previous reply.

my test.txt

Me Sa

unread,
Oct 5, 2014, 12:04:41 PM10/5/14
to ns-3-...@googlegroups.com
hi again.
I read tutorial File and executed follows command in terminal:
$ ./waf --run fifth > my_test.dat
---------------------------------------------------
$ gnuplot
gnuplot> set terminal png size 640,480
gnuplot> set output "me.png"
gnuplot> plot "me.dat" using 1:2 title ’LTE throughput’ with linespoints
in this step i have a problem as follows:

warning: Skipping data file with no valid points
                                                                           ^
         x range is invalid

what is X valid range?
can anyone help me?

Me Sa

unread,
Oct 5, 2014, 12:06:28 PM10/5/14
to ns-3-...@googlegroups.com

im sorry that was a mistake in previous post
i executes this command:
$ ./waf --run my_code > my_test.dat

Me Sa

unread,
Oct 7, 2014, 7:05:22 AM10/7/14
to ns-3-...@googlegroups.com
can anyone help me how can I resolve this problem:
when I executed my code and want to make a png file, there is a problem as follow:
warning: Skipping data file with no valid points
                                                                           ^
         x range is invalid
i tried to resolved but could not:(

Konstantinos

unread,
Oct 7, 2014, 7:19:32 AM10/7/14
to ns-3-...@googlegroups.com
This is not an issue of NS-3. It is related to the format of your data and gnuplot. 

Me Sa

unread,
Oct 7, 2014, 7:22:05 AM10/7/14
to ns-3-...@googlegroups.com
thanks so much for reply:)


On Friday, October 3, 2014 6:01:16 PM UTC+3:30, Me Sa wrote:
Reply all
Reply to author
Forward
0 new messages