From 3c3df959580e23870bcc6e5be03e91e817501a63 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Sun, 10 Oct 2021 08:06:28 +0200 Subject: [PATCH] LibCoredump: Show frames from Loader.so if the crash occurs in it Previously we rejected all entries from Loader.so even if the faulting address was located in it, i.e. the actual issue was with the dynamic loader. We no longer do that to make debugging Loader crashes easier. --- Userland/Libraries/LibCoredump/Backtrace.cpp | 9 +++++++-- Userland/Libraries/LibCoredump/Backtrace.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibCoredump/Backtrace.cpp b/Userland/Libraries/LibCoredump/Backtrace.cpp index 6ee694440b..86b53584cb 100644 --- a/Userland/Libraries/LibCoredump/Backtrace.cpp +++ b/Userland/Libraries/LibCoredump/Backtrace.cpp @@ -105,8 +105,13 @@ void Backtrace::add_entry(const Reader& coredump, FlatPtr ip) return; } auto object_name = ip_region->object_name(); - if (object_name == "Loader.so") - return; + // Only skip addresses coming from Loader.so if the faulting instruction is not in Loader.so + if (object_name == "Loader.so") { + if (m_skip_loader_so) + return; + } else { + m_skip_loader_so = true; + } // We need to find the first region for the object, just in case // the PT_LOAD header for the .text segment isn't the first one // in the object file. diff --git a/Userland/Libraries/LibCoredump/Backtrace.h b/Userland/Libraries/LibCoredump/Backtrace.h index e22ecb4269..a8a300bd62 100644 --- a/Userland/Libraries/LibCoredump/Backtrace.h +++ b/Userland/Libraries/LibCoredump/Backtrace.h @@ -47,6 +47,7 @@ private: void add_entry(const Reader&, FlatPtr ip); ELFObjectInfo const* object_info_for_region(ELF::Core::MemoryRegionInfo const&); + bool m_skip_loader_so { false }; ELF::Core::ThreadInfo m_thread_info; Vector m_entries; HashMap> m_debug_info_cache;