diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2024-06-10 18:42:07 +0200 |
---|---|---|
committer | Frederic Weisbecker <frederic@kernel.org> | 2024-07-29 21:57:34 +0200 |
commit | 45c4225c3dcc7db2c0cdbf889cc7a9c72a53f742 (patch) | |
tree | 4a832a2a29ec878490284e078407e53c5cdd1a50 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 0af02a8e356fc6d3b1eebb32fae7d35625127835 (diff) |
selftests/timers/posix_timers: Add SIG_IGN test
Add a test case to validate correct behaviour vs. SIG_IGN.
The posix specification states:
"Setting a signal action to SIG_IGN for a signal that is pending shall
cause the pending signal to be discarded, whether or not it is blocked."
The kernel implements this in the signal handling code, but due to the way
how posix timers are handling SIG_IGN for periodic timers, the behaviour
after installing a real handler again is inconsistent and suprising.
The following sequence is expected to deliver a signal:
install_handler(SIG);
block_signal(SIG);
timer_create(...); <- Should send SIG
timer_settime(value=100ms, interval=100ms);
sleep(1); <- Timer expires and queues signal, timer is not rearmed
as that should happen in the signal delivery path
ignore_signal(SIG); <- Discards queued signal
install_handler(SIG); <- Restore handler, should rearm but does not
sleep(1);
unblock_signal(SIG); <- Should deliver one signal with overrun count
set in siginfo
This fails because nothing rearms the timer when the signal handler is
restored. Add a test for this case which fails until the signal and posix
timer code is fixed.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions