mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 13:25:07 +00:00
Kernel: Defer signal handling without a register capture earlier
We were deferring the signal handling after already marking the signal as handling, which led to some failures in the Shell tests.
This commit is contained in:
parent
011bd06053
commit
853f7092f8
1 changed files with 7 additions and 7 deletions
|
@ -979,6 +979,13 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal)
|
||||||
// FIXME: Implement SA_SIGINFO signal handlers.
|
// FIXME: Implement SA_SIGINFO signal handlers.
|
||||||
VERIFY(!(action.flags & SA_SIGINFO));
|
VERIFY(!(action.flags & SA_SIGINFO));
|
||||||
|
|
||||||
|
if (!current_trap() && !action.handler_or_sigaction.is_null()) {
|
||||||
|
// We're trying dispatch a handled signal to a user process that was scheduled
|
||||||
|
// after a yielding/blocking kernel thread, we don't have a register capture of
|
||||||
|
// the thread, so just defer processing the signal to later.
|
||||||
|
return DispatchSignalResult::Deferred;
|
||||||
|
}
|
||||||
|
|
||||||
// Mark this signal as handled.
|
// Mark this signal as handled.
|
||||||
m_pending_signals &= ~(1 << (signal - 1));
|
m_pending_signals &= ~(1 << (signal - 1));
|
||||||
m_have_any_unmasked_pending_signals.store((m_pending_signals & ~m_signal_mask) != 0, AK::memory_order_release);
|
m_have_any_unmasked_pending_signals.store((m_pending_signals & ~m_signal_mask) != 0, AK::memory_order_release);
|
||||||
|
@ -1035,13 +1042,6 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal)
|
||||||
return DispatchSignalResult::Continue;
|
return DispatchSignalResult::Continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!current_trap()) {
|
|
||||||
// We're trying dispatch a signal to a user process that was scheduled after
|
|
||||||
// a yielding/blocking kernel thread, we don't have a register capture of the
|
|
||||||
// thread, so just defer processing the signal to later.
|
|
||||||
return DispatchSignalResult::Deferred;
|
|
||||||
}
|
|
||||||
|
|
||||||
ScopedAddressSpaceSwitcher switcher(m_process);
|
ScopedAddressSpaceSwitcher switcher(m_process);
|
||||||
|
|
||||||
u32 old_signal_mask = m_signal_mask;
|
u32 old_signal_mask = m_signal_mask;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue