kernel: Show stacktraces on all signal terminations

This commit is contained in:
apio 2024-01-04 21:04:24 +01:00
parent e34395915d
commit 2a85a7473a
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 4 additions and 3 deletions

View File

@ -95,8 +95,6 @@ void handle_cpu_exception(int signo, const char* err, Registers* regs)
kerrorln("R12: %.16lx R13: %.16lx R14: %.16lx R15: %.16lx", regs->r12, regs->r13, regs->r14, regs->r15);
kerrorln("RIP: %.16lx CS: %.16lx SS: %.16lx FLAGS: %.16lx", regs->rip, regs->cs, regs->ss, regs->rflags);
CPU::print_stack_trace_at(regs);
if (!is_in_kernel(regs))
{
auto* current = Scheduler::current();

View File

@ -187,7 +187,10 @@ void Thread::process_pending_signals(Registers* current_regs)
switch (action)
{
case DefaultSignalAction::Ignore: return;
case DefaultSignalAction::Terminate: exit_and_signal_parent(signo | _SIGBIT);
case DefaultSignalAction::Terminate:
kwarnln("Terminating thread %d with signal %d", id, signo);
CPU::print_stack_trace_at(current_regs);
exit_and_signal_parent(signo | _SIGBIT);
case DefaultSignalAction::Stop: stop();
default: return;
}