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
4
votes
2 answers

SIGFPE Shenanigans

I'm repeating the same calculation twice, but in one I get a floating point exception while in the other I don't. #include #include #include using namespace std; int main(void) { feenableexcept(-1); double x,y,z; …
user2535797
  • 529
  • 3
  • 10
3
votes
2 answers

C++ setting floating point exception environment

I'm struggling trying to set the std::fenv in a portable way. Based on this cppreference page, it seems that fesetexceptflag(const std::fexcept_t*,int) should help me do the trick. On the other hand, I found out that GNU offers also the…
bartgol
  • 1,703
  • 2
  • 20
  • 30
3
votes
1 answer

On linux, what can cause dlopen to emit SIGFPE?

I have a library of dubious origins which is identified by file as a 32 bit executable. However, when I try to dlopen it on a 32 bit CentOS 4.4 machine, dlopen terminates with SIGFPE. Surely if there was something wrong with the format of the…
kdt
  • 27,905
  • 33
  • 92
  • 139
3
votes
1 answer

C++ std::unordered_set SIGFPE exception

I wrote a program and I'm quite amused by the fact that I'd run it dozens of times -- I've even wrote down results from multiple executions --, and now it does not work. You might think I'm high as a kite to say so, or that I might have simply…
Rubens
  • 14,478
  • 11
  • 63
  • 92
2
votes
1 answer

gdb: SIGFPE within a loop

I have a SIGFPE happening within a loop. If I set a breakpoint or handle the SIGFPE with stop, nopass, etc, i loose the frame variables after this line. In the case of a breakpoint, I need to first get there by executing n N, where N is a large…
tmaric
  • 5,347
  • 4
  • 42
  • 75
2
votes
0 answers

Global symbol `_END_' has non-global binding

I am porting an application on Solaris 11_x86 system. When I compile it using `make, I get these errors: Linking ... collect2: ld terminated with signal 8 [Arithmetic Exception], core dumped ld: warning: global symbol `_END_' has…
user820892
2
votes
0 answers

How Can I Install Python 2.7 From Source With fpectl Module?

I am attempting to install Python 2.7.14 from source inside of a Docker container with the fpectl module enabled. Using the official Python jessie Dockerfile as a starting point, I have added the --with-fpectl configuration option to the ./configure…
michaelxor
  • 697
  • 6
  • 16
2
votes
0 answers

PowerPC: integer division does not generate SIGFPE

I have Implemented following code in QNX to handle divided by zero exception. static int st_iThreadID = -1; static sigjmp_buf fpe_env; float a = -10, b = 0; volatile float c = 0; /************************************** * * Signal Handler for…
2
votes
1 answer

Why does this gives a runtime floating point error?

I am doing an assignment for school which introduced hashmaps, and so I am creating a templated class for a hashmap that uses the std::hash function. The problem that I am having comes in my insert function, which is shown below: template
shermanzach
  • 591
  • 1
  • 6
  • 14
2
votes
1 answer

Why floating point exception does not occur?

I'm learning about arithmetic of floating point number. And I wrote following code. But floating point exception does not occur. My environment is Cent OS 6.4 (x86_64). Please teach me this reason. #include int main(void) { double…
kuni255
  • 83
  • 8
2
votes
2 answers

Core dump with SIGFPE for non-zero division

I have a qemu-kvm process suspiciously core dumped with SIGFPE: Program terminated with signal 8, Arithmetic exception. #0 bdrv_exceed_io_limits (bs=0x7f75916b7270, is_write=false, nb_sectors=1) at…
admiring_shannon
  • 904
  • 6
  • 16
1
vote
0 answers

When I run this C++ code I got Runtime error 'SIGFPE' on Codechef. How to fix this problem?

/* When I run this C++ code I got Runtime error 'SIGFPE' on Codechef. How to fix this problem? Explanation Test case 1 : Optimal filling is [5,0,5,0,5,0,5,0,5,0] Test case 2 : Optimal filling is [6,6,5,6,6,0,6,6] Test case 3 : Optimal filling…
1
vote
0 answers

What is the difference between test FPE and trap FPE?

Currently I'm learning about floating point errors. In the slide I'm learning from mentions testing and trapping. This suggests that there is a clear distinction between the two. Unfortunately I haven't found what the difference is. On the same…
Tim
  • 415
  • 2
  • 10
1
vote
2 answers

How to produce codes that always trigger signal SIGFPE(div by zero)?

I need to code a unit-test that should always trigger a divied by zero signal(SIGFPE), so I can test and compare what would happen with/without my signal catching module. My Linux signal catching/resuming module has been developed, and worked as…
Leon
  • 1,489
  • 1
  • 12
  • 31
1
vote
1 answer

sqrtf() throws a domain error, even though I guard against negative numbers

I am normalizing a 3D vector, and the clang-9 generated code throws a SIGFPE on the sqrtf() even though I do a test before calling it. Note that I run with FP exceptions enabled. const float lensq = dx*dx + dy*dy + dz*dz; …
Bram
  • 7,440
  • 3
  • 52
  • 94