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
1
vote
0 answers

How to debug sigfpe when divide-by-zero doesn't occur

I'm trying to compile ruby with O0 -ggdb3 on sw64---- a alpha-like arch and met a weird SIGFPE error: (gdb) bt #0 0x000002000544463c in __divlu () from /lib/libc.so.6.1 #1 0x0000020001fe6808 in distance_multiply ( d=18446744073709551615,…
Chen Li
  • 4,824
  • 3
  • 28
  • 55
1
vote
0 answers

Why SIGFPE when INT_MIN is divide by -1

It's a simple code as following: #include #include #include int main(){ int b = INT_MIN; int c = -1; int a = b/c; } When running the code after compilation, a SIGFPE appears: [1] 27835 floating point…
H Han
  • 37
  • 3
1
vote
0 answers

Getting SIGFPE when i divide 1/1 x86_64bit

I`m trying to build a compiler from the Scheme language to X86_64bit, while debugging with the gdb in order to see where my program crashes this what is happening: (I displayed the relevant registers, you can see that rax=1, r15=1 and the command…
1
vote
1 answer

Floating point exceptions for basic trigonometric equations

I am having trouble with floating point exceptions in a subroutine that converts from geographic to geocentric coordinates. The variable geo(x) is fed into the subroutine as pairs of latitude and longitude. The variable xyz(x) is output as a triplet…
tfinley
  • 21
  • 4
1
vote
1 answer

Core file complete nonsense or could this code really have thrown a SIGFPE?

My core file claims that a SIGFPE was thrown from gcc-4.3.4/include/c++/4.3.4/bits/stl_iterator_base_funcs.h on line 176. This is here: template inline void advance(_InputIterator& __i,…
pythonic metaphor
  • 10,296
  • 18
  • 68
  • 110
1
vote
4 answers

Floating point error in C++ code for the number of possible ways to make a team of two members

I am trying to solve a question in which I need to find out the number of possible ways to make a team of two members (note: a team can have at most two person). After making this code, it works properly, but in some test cases it shows a floating…
Deepak Malhotra
  • 173
  • 1
  • 1
  • 11
1
vote
2 answers

SIGFPE with gcc and unsigned integers

I'm getting this weird behaviour from an executable compiled with different versions of gcc, all emit the SIGFPE signal and the best part is that I have no floating point of any kind in my code; if someone could shed some light on this ... I…
gzp
  • 13
  • 5
1
vote
1 answer

Disable FPE handler on run-time in Fortran

I have a library written in Fortran that uses Intel's MKL (linked statically). I'm using ifort for compiling and linking. When I link my library (dynamically) with some other code using the -fpe0 option, I get floating point exceptions in the MKL,…
fpnick
  • 419
  • 2
  • 6
  • 18
1
vote
1 answer

What is a "FPE_FLTSUB: subscript out of range" signal?

In sys/signal.h, one of the possible codes for a SIGFPE is a FPE_FLTSUB for which the comment just says "subscript out of range -NOTIMP". I'm on OS X 10.9, but it appears to be in glibc as well. It isn't one of the standard IEEE exceptions, so what…
Simon Byrne
  • 7,694
  • 1
  • 26
  • 50
1
vote
2 answers

C++ Return value on FPE

Background I have a program which sometimes throws floating point exceptions due (primarily) to divide by zero despite having checks in place for dividing by zero values. This could be related to floating point speculation but I'm not sure. I have…
Dan
  • 12,857
  • 7
  • 40
  • 57
0
votes
1 answer

SIGFP - But no division by 0 or by big number | MASM/UASM

Performing a division by 10, I get a "floating point exception". when stepping through the code in GDB, I find that ax = 23 and bx = 10 when dividing. .686 ; ; BSS SEGMENT …
Maximilian Wittmer
  • 173
  • 1
  • 3
  • 14
0
votes
1 answer

Why floating point error message is not printing on stderr?

I am running c language code using a java application using java.lang.ProcessBuilder. If any output and error generated by this c language code, I am able to read those via process.getInputStream() and process.getErrorStream(). But in some cases…
Aayush Jain
  • 183
  • 1
  • 11
0
votes
1 answer

Why would clEnqueueNDRangeKernel crash with a floating-point exception?

I'm trying to launch a certain kernel using clEnqueueNDRangeKernel(), from within a C++ program. But instead of enqueuing, or returning an error, it gets a floating-point exception signal (SIGFPE). For IP reasons which I can't go into, it's…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
0
votes
0 answers

Fortran 90 GDB signal SIGFPE, Arithmetic exception

I am trying to debug with GDB, and am encountering an arithmetic error when trying to compare two values. The first value is set at the top of the module as double precision, parameter, public :: Dint = -1.D99 The second value happens to be inta =…
Jacob Shirley
  • 63
  • 1
  • 4
0
votes
1 answer

SIGFPE, Arithmetic exception with well-defined division

I have the following piece of c++ code: void update(const int step, const int total) const { double s = static_cast(step); double t = static_cast(total); std::cout << s/t <<"------\n"; // etc... } I am using the intel…
Dante
  • 11
  • 2