mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel: Halt CPU on deadly UBSAN instead of calling PANIC
The separate backtrace that the PANIC emits isn't useful and just adds more data to visually filter from the output when debugging an issue. Instead of calling PANIC, just emit the message with dbgln() and manually halt the system.
This commit is contained in:
parent
db78331741
commit
f982ef0ef0
Notes:
sideshowbarker
2024-07-18 18:07:39 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/f982ef0ef09 Pull-request: https://github.com/SerenityOS/serenity/pull/7125
1 changed files with 5 additions and 3 deletions
|
@ -5,8 +5,8 @@
|
|||
*/
|
||||
|
||||
#include <AK/Format.h>
|
||||
#include <Kernel/Arch/x86/CPU.h>
|
||||
#include <Kernel/KSyms.h>
|
||||
#include <Kernel/Panic.h>
|
||||
#include <Kernel/UBSanitizer.h>
|
||||
|
||||
using namespace Kernel;
|
||||
|
@ -24,8 +24,10 @@ static void print_location(const SourceLocation& location)
|
|||
dbgln("KUBSAN: at {}, line {}, column: {}", location.filename(), location.line(), location.column());
|
||||
}
|
||||
dump_backtrace();
|
||||
if (g_ubsan_is_deadly)
|
||||
PANIC("UB is configured to be deadly.");
|
||||
if (g_ubsan_is_deadly) {
|
||||
dbgln("UB is configured to be deadly, halting the system.");
|
||||
Processor::halt();
|
||||
}
|
||||
}
|
||||
|
||||
void __ubsan_handle_load_invalid_value(const InvalidValueData&, ValueHandle) __attribute__((used));
|
||||
|
|
Loading…
Reference in a new issue