mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-16 04:35:58 +00:00
Kernel: Track when a thread is in the middle of crashing
There are certain checks that we should skip if the system is crashing. The system can avoid stack overflow during crash, or even triple faulting while while handling issues that can causes recursive panics or aborts.
This commit is contained in:
committed by
Andreas Kling
parent
f56bdd2bb7
commit
0718afa773
@@ -10,6 +10,7 @@
|
||||
#include <Kernel/IO.h>
|
||||
#include <Kernel/KSyms.h>
|
||||
#include <Kernel/Panic.h>
|
||||
#include <Kernel/Thread.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
@@ -25,6 +26,11 @@ namespace Kernel {
|
||||
|
||||
void __panic(const char* file, unsigned int line, const char* function)
|
||||
{
|
||||
// Avoid lock ranking checks on crashing paths, just try to get some debugging messages out.
|
||||
auto thread = Thread::current();
|
||||
if (thread)
|
||||
thread->set_crashing();
|
||||
|
||||
critical_dmesgln("at {}:{} in {}", file, line, function);
|
||||
dump_backtrace(PrintToScreen::Yes);
|
||||
if (kernel_command_line().boot_mode() == BootMode::SelfTest)
|
||||
|
||||
Reference in New Issue
Block a user