Closed ayende closed 3 years ago
This is when capturing .Current()
stack rather than an Exception stack?
Yes, this is what is failing for me:
allocator._initializeStackTrace = EnhancedStackTrace.Current();
We are also hitting this:
16:56:42 V1000.StorageSystems.RefreshNimble.GivenStorageSystemWithNameChangedOutOfBandWhenRefreshingThenNameIsUpdated [FAIL]
16:57:08 System.InvalidOperationException : Late bound operations cannot be performed on fields with types for which Type.ContainsGenericParameters is true.
16:57:08 Stack Trace:
16:57:08 at System.Reflection.RtFieldInfo.InternalGetValue(Object obj, StackCrawlMark& stackMark)
16:57:08 at System.Reflection.RtFieldInfo.GetValue(Object obj)
16:57:08 C:\GitHub\Ben.Demystifier\src\Ben.Demystifier\EnhancedStackTrace.Frames.cs(142,0): at System.Diagnostics.EnhancedStackTrace.GetMethodDisplayString(MethodBase originMethod)
16:57:08 C:\GitHub\Ben.Demystifier\src\Ben.Demystifier\EnhancedStackTrace.Frames.cs(70,0): at System.Diagnostics.EnhancedStackTrace.GetFrames(StackTrace stackTrace)
16:57:08 C:\GitHub\Ben.Demystifier\src\Ben.Demystifier\EnhancedStackTrace.cs(47,0): at System.Diagnostics.EnhancedStackTrace..ctor(StackTrace stackTrace)
field's declaring type is generic, IsConstructedGenericType is false. This means it will throw ...
System.InvalidOperationException: Late bound operations cannot be performed on fields with types for which Type.ContainsGenericParameters is true.
at System.Reflection.RtFieldInfo.InternalGetValue(Object obj, StackCrawlMark& stackMark)
at System.Reflection.RtFieldInfo.GetValue(Object obj)
Going to fork this and provide a work-around by skipping the field value evaluation if !IsConstructedGenericType and just checking the field name, but I think the type diagnosis for the generic type's parameters (to turn the GTD into a CGT) will be either impossible or require looking at previous stack frames or heaven forbid the this
variable in the frame.
Since #77 is merged, this might be resolved. @ayende can you test with latest?
Going to close this ass assumed fixed
The real stack trace is: