mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-30 14:20:21 +00:00
Kernel: Send SIGSEGV on seg-fault
Now programs can catch the SIGSEGV signal when they segfault. This commit also introduced the send_urgent_signal_to_self method, which is needed to send signals to a thread when handling exceptions caused by the same thread.
This commit is contained in:
parent
7fc903b97a
commit
c136fd3fe2
Notes:
sideshowbarker
2024-07-19 11:45:46 +09:00
Author: https://github.com/DrewStratford
Commit: c136fd3fe2
Pull-request: https://github.com/SerenityOS/serenity/pull/637
Reviewed-by: https://github.com/awesomekling
3 changed files with 31 additions and 0 deletions
|
@ -262,6 +262,11 @@ void exception_14_handler(RegisterDump& regs)
|
|||
auto response = MM.handle_page_fault(PageFault(regs.exception_code, VirtualAddress(fault_address)));
|
||||
|
||||
if (response == PageFaultResponse::ShouldCrash) {
|
||||
if(current->has_signal_handler(SIGSEGV)){
|
||||
current->send_urgent_signal_to_self(SIGSEGV);
|
||||
return;
|
||||
}
|
||||
|
||||
kprintf("\033[31;1m%s(%u:%u) Unrecoverable page fault, %s address %p\033[0m\n",
|
||||
current->process().name().characters(),
|
||||
current->pid(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue