From 1ead2ed5eea379c500d2657e7bed8908b376e336 Mon Sep 17 00:00:00 2001 From: meta7 Date: Tue, 10 Aug 2010 09:07:17 -0700 Subject: Add a stack trace to the error output on the recursive read lock warning on my RWlocks. Whilst recursive locks are safe, coupled with other issues we're experiencing with the TaskInventoryDictionary it implies that somewhere the lock is not being freed possibly due to a merge error somewhere, and thus it needs to be looked into. --- OpenSim/Framework/TaskInventoryDictionary.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'OpenSim/Framework/TaskInventoryDictionary.cs') diff --git a/OpenSim/Framework/TaskInventoryDictionary.cs b/OpenSim/Framework/TaskInventoryDictionary.cs index 4b9a509..6b65fba 100644 --- a/OpenSim/Framework/TaskInventoryDictionary.cs +++ b/OpenSim/Framework/TaskInventoryDictionary.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.Threading; using System.Reflection; using System.Xml; +using System.Diagnostics; using System.Xml.Schema; using System.Xml.Serialization; using log4net; @@ -90,6 +91,19 @@ namespace OpenSim.Framework if (m_itemLock.RecursiveReadCount > 0) { m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue."); + try + { + StackTrace stackTrace = new StackTrace(); // get call stack + StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames) + + // write call stack method names + foreach (StackFrame stackFrame in stackFrames) + { + m_log.Error("[SceneObjectGroup.m_parts] "+(stackFrame.GetMethod().Name); // write method name + } + } + catch + {} m_itemLock.ExitReadLock(); } if (m_itemLock.RecursiveWriteCount > 0) -- cgit v1.1