简体   繁体   English

Visual Studio DebuggerVisualizer中的StackOverflowException

[英]StackOverflowException in Visual Studio DebuggerVisualizer

I'm developing Visual Studio debugger visualizer. 我正在开发Visual Studio调试器可视化器。 It worked fine but then (unexpectedly) it become broken. 它工作正常,但随后(意外)损坏。 I can not figure out why it happend because I didn't changed anything important. 我不知道为什么会发生,因为我没有更改任何重要的内容。

So now I get An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll 所以现在我An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll收到An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll

Here is my code: 这是我的代码:

var visualizerHost = new VisualizerDevelopmentHost(objectToVisualize, typeof(DebuggerSide));
visualizerHost.ShowVisualizer();

And here is the stack trace after visualizerHost.ShowVisualizer() call: 这是visualizerHost.ShowVisualizer()调用之后的堆栈跟踪:

System.RuntimeTypeHandle.GetTypeByName(string name, bool throwOnError, bool ignoreCase, bool reflectionOnly, ref System.Threading.StackCrawlMark stackMark, System.IntPtr pPrivHostBinder, bool loadTypeFromPartialName) + 0x99 bytes   
System.RuntimeTypeHandle.GetTypeByName(string name, bool throwOnError, bool ignoreCase, bool reflectionOnly, ref System.Threading.StackCrawlMark stackMark, bool loadTypeFromPartialName) + 0x25 bytes  
System.Runtime.Remoting.RemotingServices.LoadClrTypeWithPartialBindFallback(string typeName, bool partialFallback) + 0x3b bytes 
System.Runtime.Remoting.RemotingServices.InternalGetTypeFromQualifiedTypeName(string qualifiedTypeName, bool partialFallback) + 0x4c bytes  
System.Runtime.Remoting.RemotingServices.GetType(object tp) + 0xce bytes    
System.Runtime.Serialization.SerializationInfo.AddValue(string name, object value) + 0x1d bytes 
System.Runtime.Remoting.Messaging.LogicalCallContext.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) + 0x145 bytes    
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(object obj, System.Runtime.Serialization.ISurrogateSelector surrogateSelector, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.Formatters.Binary.SerObjectInfoInit serObjectInfoInit, System.Runtime.Serialization.IFormatterConverter converter, System.Runtime.Serialization.Formatters.Binary.ObjectWriter objectWriter, System.Runtime.Serialization.SerializationBinder binder) + 0x31b bytes 
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(object obj, System.Runtime.Serialization.ISurrogateSelector surrogateSelector, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.Formatters.Binary.SerObjectInfoInit serObjectInfoInit, System.Runtime.Serialization.IFormatterConverter converter, System.Runtime.Serialization.Formatters.Binary.ObjectWriter objectWriter, System.Runtime.Serialization.SerializationBinder binder) + 0x10e bytes 
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(object graph, System.Runtime.Remoting.Messaging.Header[] inHeaders, System.Runtime.Serialization.Formatters.Binary.__BinaryWriter serWriter, bool fCheck) + 0x32e bytes   
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(System.IO.Stream serializationStream, object graph, System.Runtime.Remoting.Messaging.Header[] headers, bool fCheck) + 0x142 bytes 
System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage.SmuggledMethodCallMessage(System.Runtime.Remoting.Messaging.IMethodCallMessage mcm) + 0x460 bytes   
System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg = {System.Runtime.Remoting.Messaging.Message}) + 0x11d bytes   
System.Runtime.Remoting.Proxies.RemotingProxy.CallProcessMessage(System.Runtime.Remoting.Messaging.IMessageSink ms, System.Runtime.Remoting.Messaging.IMessage reqMsg, System.Runtime.Remoting.Contexts.ArrayWithSize proxySinks, System.Threading.Thread currentThread, System.Runtime.Remoting.Contexts.Context currentContext, bool bSkippingContextChain) + 0x8c bytes  
System.Runtime.Remoting.Proxies.RemotingProxy.InternalInvoke(System.Runtime.Remoting.Messaging.IMethodCallMessage reqMcmMsg, bool useDispatchMessage, int callType) + 0x22c bytes   
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(ref System.Runtime.Remoting.Proxies.MessageData msgData, int type) + 0x1f4 bytes    
Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.DelegatedHost.HostResolver.ResolveRemoteAssembly(string fullAssemblyName = "nunit.core, Version=2.6.2.12296, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77") + 0x99 bytes 
Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.DelegatedHost.HostResolver.ResolveName(string fullAssemblyName = "nunit.core, Version=2.6.2.12296, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77", bool noVersion = false, bool cacheOnly = false) + 0x94 bytes   
Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.AbstractAssemblyResolver.ResolveName(string fullAssemblyName = "nunit.core, Version=2.6.2.12296, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77", bool cacheOnly = false) + 0x53 bytes 
Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.AbstractAssemblyResolver.ResolveName(string fullAssemblyname = "nunit.core, Version=2.6.2.12296, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77") + 0x6e bytes 
Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.AbstractAssemblyResolver.ResolveHandler(object source = {System.AppDomain}, System.ResolveEventArgs resolveArgs = {System.ResolveEventArgs}) + 0x58 bytes    
System.AppDomain.OnAssemblyResolveEvent(System.Reflection.RuntimeAssembly assembly, string assemblyFullName) + 0xbc bytes   
[Native to Managed Transition]  
[Managed to Native Transition]  
System.RuntimeTypeHandle.GetTypeByName(string name, bool throwOnError, bool ignoreCase, bool reflectionOnly, ref System.Threading.StackCrawlMark stackMark, System.IntPtr pPrivHostBinder, bool loadTypeFromPartialName) + 0x99 bytes   
System.RuntimeTypeHandle.GetTypeByName(string name, bool throwOnError, bool ignoreCase, bool reflectionOnly, ref System.Threading.StackCrawlMark stackMark, bool loadTypeFromPartialName) + 0x25 bytes  
System.Runtime.Remoting.RemotingServices.LoadClrTypeWithPartialBindFallback(string typeName, bool partialFallback) + 0x3b bytes 
System.Runtime.Remoting.RemotingServices.InternalGetTypeFromQualifiedTypeName(string qualifiedTypeName, bool partialFallback) + 0x4c bytes  
System.Runtime.Remoting.RemotingServices.GetType(object tp) + 0xce bytes    
System.Runtime.Serialization.SerializationInfo.AddValue(string name, object value) + 0x1d bytes 
System.Runtime.Remoting.Messaging.LogicalCallContext.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) + 0x145 bytes    
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(object obj, System.Runtime.Serialization.ISurrogateSelector surrogateSelector, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.Formatters.Binary.SerObjectInfoInit serObjectInfoInit, System.Runtime.Serialization.IFormatterConverter converter, System.Runtime.Serialization.Formatters.Binary.ObjectWriter objectWriter, System.Runtime.Serialization.SerializationBinder binder) + 0x31b bytes 
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(object obj, System.Runtime.Serialization.ISurrogateSelector surrogateSelector, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.Formatters.Binary.SerObjectInfoInit serObjectInfoInit, System.Runtime.Serialization.IFormatterConverter converter, System.Runtime.Serialization.Formatters.Binary.ObjectWriter objectWriter, System.Runtime.Serialization.SerializationBinder binder) + 0x10e bytes 
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(object graph, System.Runtime.Remoting.Messaging.Header[] inHeaders, System.Runtime.Serialization.Formatters.Binary.__BinaryWriter serWriter, bool fCheck) + 0x32e bytes   
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(System.IO.Stream serializationStream, object graph, System.Runtime.Remoting.Messaging.Header[] headers, bool fCheck) + 0x142 bytes 
System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage.SmuggledMethodCallMessage(System.Runtime.Remoting.Messaging.IMethodCallMessage mcm) + 0x460 bytes   
System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg = {System.Runtime.Remoting.Messaging.Message}) + 0x11d bytes   
System.Runtime.Remoting.Proxies.RemotingProxy.CallProcessMessage(System.Runtime.Remoting.Messaging.IMessageSink ms, System.Runtime.Remoting.Messaging.IMessage reqMsg, System.Runtime.Remoting.Contexts.ArrayWithSize proxySinks, System.Threading.Thread currentThread, System.Runtime.Remoting.Contexts.Context currentContext, bool bSkippingContextChain) + 0x8c bytes  
System.Runtime.Remoting.Proxies.RemotingProxy.InternalInvoke(System.Runtime.Remoting.Messaging.IMethodCallMessage reqMcmMsg, bool useDispatchMessage, int callType) + 0x22c bytes   
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(ref System.Runtime.Remoting.Proxies.MessageData msgData, int type) + 0x1f4 bytes    
Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.DelegatedHost.CreateViewer(System.IntPtr hwnd = 65552, Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.HostServicesHelper hsh = {System.Runtime.Remoting.Proxies.__TransparentProxy}, Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.SafeProxyWrapper proxy = {System.Runtime.Remoting.Proxies.__TransparentProxy}) + 0x198 bytes 
[Appdomain Transition]  
Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.IManagedViewerHost.CreateViewer(System.IntPtr hwnd = 65552, object hostServicesParam = null, Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.IPropertyProxyEESide proxy = {Microsoft.VisualStudio.DebuggerVisualizers.VisualizerDevelopmentHost.EEProxyImpl}) + 0x4df bytes    
Microsoft.VisualStudio.DebuggerVisualizers.VisualizerDevelopmentHost.EEProxyImpl.ShowVisualizer(System.IntPtr parentWindow = 65552) + 0x6c bytes    
Microsoft.VisualStudio.DebuggerVisualizers.VisualizerDevelopmentHost.ShowVisualizer(System.IntPtr parentHandle = 65552) + 0x77 bytes    
Microsoft.VisualStudio.DebuggerVisualizers.VisualizerDevelopmentHost.ShowVisualizer() + 0x41 bytes  

Block after [Native to Managed Transition] is repeated continuously causing StackOverflowException . 连续重复执行[Native to Managed Transition]之后发生阻塞,从而导致StackOverflowException

Does anybody have an idea about this issue? 有人对这个问题有想法吗?

您已经以某种方式创建了一个递归循环,但是我在您发布的代码中看不到它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM