Wrapping Signal Handlers

We want to wrap signal handlers with a glibc function, so that we can perform the following actions around a signal handler:

Desired signal behavior

Also see POSIX Signal Concepts.

State

A signal is generated by some event (either by a hardware event, or an explicit signal generation via a call to functions such as kill and pthread_kill) and delivered (when the signal handler is executed). If a signal is blocked for a thread and cannot be delivered to any other thread, it is queued and enters the pending state.

Invariants

Current implementation

The kernel has a mechanism to queue signals when they need to be delivered to a particular thread, but the signal number is blocked for that thread.

When delivering the signal, the kernel reads the signal flags and the handler atomically with regards to sigaction (that is, sigaction changes both values atomically).

Challenges

Things that do not work

Potential kernel changes

None: SignalHandlerWrapper (last edited 2020-08-28 19:11:24 by JoshTriplett)