You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to replace division by 0 with explicit raise(SIGFPE) but with no succes. For some reson the stacktrace misses the function name.
diff --git a/src/signalhandler_unittest.cc b/src/signalhandler_unittest.cc
index e85f523..10b0071 100644
--- a/src/signalhandler_unittest.cc+++ b/src/signalhandler_unittest.cc@@ -57,10 +57,8 @@ void* DieInThread(void*) {
// returns a pointer. Hence we use C-style cast here, rather than
// reinterpret/static_cast, to support both types of environments.
fprintf(stderr, "0x%lx is dying\n", (long)pthread_self());
- // Use volatile to prevent from these to be optimized away.- volatile int a = 0;- volatile int b = 1 / a;- fprintf(stderr, "We should have died: b=%d\n", b);+ raise(SIGFPE);+ fprintf(stderr, "We should have died!\n");
return NULL;
}
Got:
0xffff95e6a1e0 is dying
*** Aborted at 1508925684 (unix time) try "date -d @1508925684" if you are using GNU date ***
PC: @ 0x0 (unknown)
*** SIGFPE (@0x3e900007194) received by PID 29076 (TID 0xffff95e6a1e0) from PID 29076; stack trace: ***
@ 0xffff962b66c0 ([vdso]+0x6bf)
@ 0xffff96223d60 raise
Floating point exception
Expected:
0x7f651f18c700 is dying
*** Aborted at 1508925857 (unix time) try "date -d @1508925857" if you are using GNU date ***
PC: @ 0x7f652000d269 raise
*** SIGFPE (@0x3289cb000001527) received by PID 5415 (TID 0x7f651f18c700) from PID 5415; stack trace: ***
@ 0x7f652000d390 (unknown)
@ 0x7f652000d269 raise
@ 0x40146e DieInThread()
@ 0x7f65200036ba start_thread
@ 0x7f651f7a13dd clone
[1] 5415 floating point exception ./signalhandler_unittest die_in_thread
The text was updated successfully, but these errors were encountered:
When running
make check
on ARM. Signal handler test fails. The signal:The problem is that SIGFPE is not generated on ARM
I've tried to replace division by 0 with explicit
raise(SIGFPE)
but with no succes. For some reson the stacktrace misses the function name.Got:
Expected:
The text was updated successfully, but these errors were encountered: