summaryrefslogtreecommitdiff
path: root/Kernel/Process.cpp
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-01-25 15:50:18 +0200
committerIdan Horowitz <idan.horowitz@gmail.com>2022-01-26 02:37:03 +0200
commit1abbe9b02ce235a588aa56a4b80bca444eb1a1ec (patch)
tree934d5aa2e77c9f7c5ae5b223c07d5b5bc8299eb7 /Kernel/Process.cpp
parentd1433c35b0edc580f753ebd68b1582853f042a99 (diff)
downloadserenity-1abbe9b02ce235a588aa56a4b80bca444eb1a1ec.zip
Kernel: Ignore allocation failures when appending threads to coredump
We shouldn't panic due to a failure in coredump generation
Diffstat (limited to 'Kernel/Process.cpp')
-rw-r--r--Kernel/Process.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index 278e2f7b58..7191cd0611 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -659,7 +659,9 @@ void Process::die()
VERIFY(m_threads_for_coredump.is_empty());
for_each_thread([&](auto& thread) {
- m_threads_for_coredump.append(thread);
+ auto result = m_threads_for_coredump.try_append(thread);
+ if (result.is_error())
+ dbgln("Failed to add thread {} to coredump due to OOM", thread.tid());
});
all_instances().with([&](const auto& list) {