diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-05-18 17:31:52 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-18 17:33:05 +0200 |
commit | d2c3749cf3269d28726589b7c077d824dd97b1dd (patch) | |
tree | 889a244c6b9b7a3bf5a8a6fb49c0e8c3153cc5a3 | |
parent | ec0d598934ad9e534cd36a9d35c757716a4b7de4 (diff) | |
download | serenity-d2c3749cf3269d28726589b7c077d824dd97b1dd.zip |
Kernel: Don't allow dump_backtrace() to call dump_backtrace().
That was not a very graceful looking loop to be stuck in.
-rw-r--r-- | Kernel/KSyms.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Kernel/KSyms.cpp b/Kernel/KSyms.cpp index 38719cd1bb..876c2d538b 100644 --- a/Kernel/KSyms.cpp +++ b/Kernel/KSyms.cpp @@ -3,6 +3,7 @@ #include "Scheduler.h" #include <Kernel/FileSystem/FileDescriptor.h> #include <Kernel/ELF/ELFLoader.h> +#include <AK/TemporaryChange.h> static KSym* s_ksyms; dword ksym_lowest_address; @@ -132,6 +133,12 @@ static void load_ksyms_from_data(const ByteBuffer& buffer) void dump_backtrace() { + static bool in_dump_backtrace = false; + if (in_dump_backtrace) { + dbgprintf("dump_backtrace() called from within itself, what the hell is going on!\n"); + return; + } + TemporaryChange change(in_dump_backtrace, true); dword ebp; asm volatile("movl %%ebp, %%eax":"=a"(ebp)); dump_backtrace_impl(ebp, ksyms_ready); |