mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
Kernel: Dump stack trace when kmalloc() fails.
This commit is contained in:
parent
e84faadb63
commit
6c950f8f83
Notes:
sideshowbarker
2024-07-19 14:35:39 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/6c950f8f830
1 changed files with 2 additions and 0 deletions
|
@ -106,6 +106,7 @@ void* kmalloc_impl(size_t size)
|
|||
size_t real_size = size + sizeof(allocation_t);
|
||||
|
||||
if (sum_free < real_size) {
|
||||
dump_backtrace(ksyms_ready);
|
||||
kprintf("%s(%u) kmalloc(): PANIC! Out of memory (sucks, dude)\nsum_free=%u, real_size=%u\n", current->process().name().characters(), current->pid(), sum_free, real_size);
|
||||
hang();
|
||||
}
|
||||
|
@ -159,6 +160,7 @@ void* kmalloc_impl(size_t size)
|
|||
}
|
||||
|
||||
kprintf("%s(%u) kmalloc(): PANIC! Out of memory (no suitable block for size %u)\n", current->process().name().characters(), current->pid(), size);
|
||||
dump_backtrace(ksyms_ready);
|
||||
hang();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue