Hello,
This is a repost of http://community.sharpdevelop.net/forums/p/7277/20860.aspx#20860.
I repost it here because it looks like a generic problem, not a debugger-related one. This bug is still present using the latest build (2980) and Vista SP1.
---
Here is an annoying but easily reproducible occurrence of
the “state of the thread is invalid” exception. Using a fully patched
32 bit Vista Business (without SP1) and the latest build of SD we have
to:
1) Use SharpDevelop 3.0.0.2954;
2) Load the SharpDevelop source (same build) and wait for the loading to complete;
3) Press F5 to start debugging
4) Once the start page is displayed, the bottom pad is positioned on “Output”
5) Click on “Task List” and then on “Definition View”, you will get the exception (see below)
Note that using exactly the same setup, the bug does not occur on an (vmware based) XP system.
It seems that this bug was introduced with the latest builds only (around the beginning of last week)
SharpDevelop Version : 3.0.0.2954
.NET Version : 2.0.50727.1433
OS Version : Microsoft Windows NT 6.0.6000.0
Current culture : French (France) (fr-FR)
Current UI language : en-US
Working Set Memory : 260744kb
GC Heap Memory : 159928kb
Exception thrown:
System.Runtime.InteropServices.COMException
(0x8013132D): The state of the thread is invalid. (Exception from
HRESULT: 0x8013132D)
at Debugger.Interop.CorDebug.ICorDebugThread.EnumerateChains(ICorDebugChainEnum& ppChains)
at Debugger.Wrappers.CorDebug.ICorDebugThread.EnumerateChains()
at Debugger.Thread.<get_CallstackEnum>d__0.MoveNext()
at Debugger.Thread.get_MostRecentStackFrameWithLoadedSymbols()
at Debugger.Process.SelectMostRecentStackFrameWithLoadedSymbols()
at Debugger.ManagedCallback.Pause()
at Debugger.ManagedCallback.ExitCallback()
at Debugger.ManagedCallback.Exception2(ICorDebugAppDomain pAppDomain,
ICorDebugThread pThread, ICorDebugFrame pFrame, UInt32 nOffset,
CorDebugExceptionCallbackType exceptionType, UInt32 dwFlags)
at Debugger.ManagedCallbackProxy.<>c__DisplayClass58.<Exception>b__57()
at Debugger.Interop.MTA2STA.<>c__DisplayClass3.<EnqueueCall>b__0()
at Debugger.Interop.MTA2STA.PerformCall()
at Debugger.Interop.MTA2STA.PerformAllCalls()
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
Thank you for looking into it.