ABSTRACT
Hardware-generated signals SIGFPE and SIGSEGV result in program lockup
when Photon signal handlers have been defined for these signals using
PtAppAddSignalProc().
DETAILS
The App: A Photon app that uses PtAppAddSignalProc() to add a handler for
several signals, including the “hardware-generated” signals SIGFPE and
SIGSEGV.
The app has a debug menu that allows me to cause these signals to be
raised –
e.g., division by zero, null pointer assignment.
The Problem: When a hardware-generated error occurs, the app locks up. It
never
gets to my signal handler. The debugger never returns from the ‘int 0F2’
assembler
instruction. Running ‘sin -P myapp sig’ multiple times shows the pending
signal and
mask for the app continually changing – for example:
SIG MASK SIG PEND
00000000 00000080 // pending
00000080 00000000 // masked
00000000 00000000 // clear
00000080 00000000 // masked
00000000 00000080 // pending
What Works: The signal handler does what it is supposed to do when I send it
signals externally using ‘slay’, or internally using raise() or kill(), even
for SIGFPE
and SIGSEGV. If I don’t add a signal handler for SIGFPE and SIGSEGV using
PtAppAddSignalProc(), the program terminates as expected.
What’s Happening?: It looks like the signal keeps being generated. Is it
possible
that the kernel keeps returning to the offending code that caused the error?
This has me baffled.