帮助调试stackoverflow - 重复堆栈的后续步骤?

时间:2010-10-05 20:18:55

标签: .net winforms debugging stack-overflow windbg

民间,

我的.net 4.0应用程序中出现了堆栈溢出。使用WinDbg我发现以下大量的stack-info重复了110次(当然使用不同的内存地址),这让我相信这就是溢出的情况。问题是,这似乎都不像我的代码!有关如何进行调试的任何建议吗?

000000000008e630 000007fef22d10b4 [CustomGCFrame: 000000000008e630] 
000000000008e5f8 000007fef22d10b4 [GCFrame: 000000000008e5f8] 
000000000008e588 000007fef22d10b4 [GCFrame: 000000000008e588] 
000000000008e958 000007fef22d10b4 [HelperMethodFrame_PROTECTOBJ: 000000000008e958] System.RuntimeMethodHandle._InvokeMethodFast(System.IRuntimeMethodInfo, System.Object, System.Object[], System.SignatureStruct ByRef, System.Reflection.MethodAttributes, System.RuntimeType)
000000000008eaa0 000007fef138587f System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, Boolean)
000000000008ebe0 000007fef13d000f System.Delegate.DynamicInvokeImpl(System.Object[])
000000000008ec50 000007feeee16127 System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry)
000000000008ec90 000007feeee16004 System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(System.Object)
000000000008ed20 000007fef1393178 System.Threading.ExecutionContext.runTryCode(System.Object)
000000000008f448 000007fef22d10b4 [HelperMethodFrame_PROTECTOBJ: 000000000008f448] System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
000000000008f570 000007fef13817e1 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
000000000008f5d0 000007fef138172b System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
000000000008f620 000007feeee15f31 System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry)
000000000008f680 000007feeee15b97 System.Windows.Forms.Control.InvokeMarshaledCallbacks()
000000000008f700 000007feeedfb7da System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
000000000008f8b0 000007feeee09a0d System.Windows.Forms.Form.WndProc(System.Windows.Forms.Message ByRef)
000000000008f990 000007feeedfb34c System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
000000000008fa60 000007feef60ef10 DomainBoundILStubClass.IL_STUB_ReversePInvoke(Int64, Int32, Int64, Int64)
000000000008fd98 000007fef236cae7 [NDirectMethodFrameStandalone: 000000000008fd98] System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG ByRef)
000000000008fd60 000007feeee271a0 DomainBoundILStubClass.IL_STUB_PInvoke(MSG ByRef)
000000000008fe30 000007feeee151d0 System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)
0000000000090070 000007feeee149d3 System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
00000000000901d0 000007feeee14361 System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
0000000000090948 000007fef22d10b4 [DebuggerU2MCatchHandlerFrame: 0000000000090948] 
0000000000090a30 000007fef22d10b4 [CustomGCFrame: 0000000000090a30] 

2 个答案:

答案 0 :(得分:4)

看起来你的应用程序递归地重新进入其UI消息循环。检查窗口的事件处理程序,例如用于处理Resize事件时调整窗口大小等内容。

答案 1 :(得分:1)

我(只)猜测这是为什么不使用Application.DoEvents()的一个很好的例子,但你应该至少知道代码导致了什么。