瀏覽代碼

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.
Brian Gianforcaro 3 年之前
父節點
當前提交
1422187427
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Kernel/Thread.cpp

+ 1 - 1
Kernel/Thread.cpp

@@ -166,6 +166,7 @@ void Thread::block(Kernel::Mutex& lock, SpinlockLocker<Spinlock>& 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<void> AK::Formatter<Kernel::Thread>::format(FormatBuilder& builder, Kernel::Thread const& value)