From 1422187427f31a911417c1135c5ad8d618642f15 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Wed, 26 Jan 2022 03:49:12 -0800 Subject: [PATCH] Kernel: Add tracing to help catch thread blocking with incorrect state A number of crashes in this `VERIFY_NOT_REACHED` case have been reported on discord. Lets add some tracing to gather more information and help diagnose what is the cause of these crashes. --- Kernel/Thread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp index 220b7bf966..11649168ac 100644 --- a/Kernel/Thread.cpp +++ b/Kernel/Thread.cpp @@ -166,6 +166,7 @@ void Thread::block(Kernel::Mutex& lock, SpinlockLocker& lock_lock, u32 VERIFY(m_blocker == nullptr); break; default: + dbgln("Error: Attempting to block with invalid thread state - {}", state_string()); VERIFY_NOT_REACHED(); } @@ -1319,7 +1320,6 @@ void Thread::track_lock_release(LockRank rank) m_lock_rank_mask ^= rank; } - } ErrorOr AK::Formatter::format(FormatBuilder& builder, Kernel::Thread const& value)