Questions tagged [sigfpe]

On POSIX-compliant platforms, SIGFPE is the signal sent to a process when it encounters an arithmetic error, such as division by zero.

On POSIX-compliant platforms, SIGFPE is the signal sent to a process when it encounters an arithmetic error, such as division by zero.

See Also:

63 questions
0
votes
0 answers

feenableexcept not permanent

I am able to use feenableexcept() to change the FPE environment. However, two lines of code later, something changes my control_word. Has anybody seen this before and know how to stop it? fedisableexcept(FE_ALL_EXCEPT); …
FirehawkTT
  • 31
  • 4
0
votes
0 answers

SIGFPE on attempt to connect port to conference

#include #include #include #include #include #include #include #define SIGNATURE PJMEDIA_SIG_CLASS_PORT_AUD('C','B') struct…
0
votes
0 answers

-2147483648 % -1 causes floating point exception

For example: #include #include #include int main(int argc, char **argv) { int a = (int) strtol(argv[1], (char**) NULL, 10); int b = (int) strtol(argv[2], (char**) NULL, 10); printf("%d %% %d = %d\n", a,…
nasso
  • 603
  • 5
  • 13
0
votes
2 answers

Operation with division resulting in error execution because of SIGFPE, Arithmetic exception

I have wrote an algorithm for MCU that executes the expression of two paralel Resistances before doing more calculations with the division result. When debugging the values had no sense; they were too much big and float var did not update their…
Suvi_Eu
  • 255
  • 1
  • 3
  • 16
0
votes
0 answers

Floating Point Co-processor Fault in module for subroutine for acceleration calculation in Fortran

I am having some trouble with two of my modules for a molecular dynamics program I am making. both occur at the force calculation in the module and I have tried changing the precision of all of my values. One of the modules is printed below. I get…
Megan McCracken
  • 43
  • 1
  • 1
  • 6
0
votes
1 answer

fortran error backtrace leads to a where loop

I am working on a large fortran code and before to compile with fast options (in order to perform test on large database), I usually compile with "warnings" options in order to detect and backtrace all the problems. So with the gfortran -fbacktrace…
R. N
  • 707
  • 11
  • 31
0
votes
1 answer

How to properly avoid SIGFPE and overflow on arithmetic operations

I've been trying to create a Fraction class as complete as possible, to learn C++, classes and related stuff on my own. Among other things, I wanted to ensure some level of "protection" against floating point exceptions and…
0
votes
1 answer

Weird floating point exception

In the code snippet below I get a floating point exception during run time. I believe the exception happens at the line where division by r is being done. When I comment that line out I get no error. Also very very strangely when I compile in gcc…
physicist
  • 844
  • 1
  • 12
  • 24
0
votes
1 answer

How do I return to mainline code from a signal handler in assembler?

I've been writing a program in NASM for Linux. I'd like to be able to return to the normal code path out of a signal handler that I've established for SIGFPE. Stripped-down sample code is: section .text global _start _start: ; ---…
Tony
  • 1,221
  • 2
  • 12
  • 25
0
votes
1 answer

gdb shared libraries no debugging information

i try to debug a program for find to floating point exception location on beaglebone black debian i installed libc6 and libc6-dbg but still From To Syms Read Shared Object Library 0xb6fda7c0 0xb6ff32b0 Yes (*) …
0
votes
1 answer

fpu ia-32, floating point exception

I'm learning ia-32 and everything was going fine on 32bit Ubuntu, but I switched to 64bit and started using the flag -m32 and now i can't use DIV anywhere, no matter the content of the registers, it gives me always Floating Point Exception... And…
Vcoder
  • 124
  • 1
  • 13
0
votes
1 answer

decoding the runtime error (SIGFPE)

This is a problem on spoj.com (http://www.spoj.com/problems/PRIC/) .We have to check whether numbers of the sequence : ai=( a(i-1)+1234567890 ) mod 2^31 are prime or not, 1st number is 1. My code is given below (Please try to ignore the…
guitar_geek
  • 498
  • 2
  • 9
  • 19
0
votes
1 answer

SIGFPE signal does not terminate and generate core file

According to UNIX advance programming documentation, the SIGFPE signal terminates the program and generates a core file. Here is my program #include #include #include #include static void sig_fpe(int…
Salman Ahmed
  • 141
  • 1
  • 3
  • 14
0
votes
1 answer

Android native application running even after segmentation fault with same PID

I'm running custom android on i.MX51 board and observed a strange issue with an application. I got logs in n logcat of segmentation fault of an application (native, written using NDK) : 03-19 15:26:46.763 I/DEBUG ( 2234): pid: 2257, tid: 2257 >>>…
androidFan
  • 611
  • 2
  • 19
  • 31
0
votes
2 answers

SIGFPE misdirection in c++

I'm trying to understand the strange behavior of the following program. Obviously, an overflow occurs during the definition of the global variable "bug", but the program throws a floating point exception during the innocent calculation 1.0+2.0.…
user2535797
  • 529
  • 3
  • 10