mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
Kernel: Handle string format error in page_fault_handler(..) :^)
Utilize the new KString::formatted to provide a fallback if formatting fails because of OOM or whatever reason.
This commit is contained in:
parent
4cc41ea186
commit
a5cec06135
1 changed files with 3 additions and 1 deletions
|
@ -403,7 +403,9 @@ void page_fault_handler(TrapFrame* trap)
|
|||
if (current_thread) {
|
||||
auto& current_process = current_thread->process();
|
||||
if (current_process.is_user_process()) {
|
||||
(void)current_process.try_set_coredump_property("fault_address"sv, String::formatted("{:p}", fault_address));
|
||||
auto fault_address_string = KString::formatted("{:p}", fault_address);
|
||||
auto fault_address_view = fault_address_string.is_error() ? ""sv : fault_address_string.value()->view();
|
||||
(void)current_process.try_set_coredump_property("fault_address"sv, fault_address_view);
|
||||
(void)current_process.try_set_coredump_property("fault_type"sv, fault.type() == PageFault::Type::PageNotPresent ? "NotPresent"sv : "ProtectionViolation"sv);
|
||||
StringView fault_access;
|
||||
if (fault.is_instruction_fetch())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue