benaadams / Ben.Demystifier

High performance understanding for stack traces (Make error logs more productive)
Apache License 2.0
2.76k stars 120 forks source link

System.Runtime.InteropServices.COMException being very annoying! #28

Open nrandell opened 7 years ago

nrandell commented 7 years ago

Got some hairy service fabric traces that contain a number of COMExceptions.

Unfortunately it looks like the stack trace for this can't be cleaned up.

Here's a subset of the stack trace!

System.Runtime.InteropServices.COMException (0x80071BCD): Exception from HRESULT: 0x80071BCD
   at System.Fabric.Interop.NativeClient.IFabricServiceManagementClient6.EndResolveServicePartition(IFabricAsyncOperationContext context)
   at System.Fabric.FabricClient.ServiceManagementClient.ResolveServicePartitionEndWrapper(IFabricAsyncOperationContext context)
   at System.Fabric.Interop.AsyncCallOutAdapter2`1.Finish(IFabricAsyncOperationContext context, Boolean expectedCompletedSynchronously)

What appears to be happening is that in EnhancedStackTrace.GetFrames(Exception) a new StackTrace is constructed from the exception, but that stack trace is empty. I think this is because the _stackTrace field is null, whilst the _stackTraceString field contains the string representation.

So at the moment I don't think anything can be easily done, however it may be worth while putting something in the documentation saying that there are some exceptions that can't be cleaned.

benaadams commented 7 years ago

Just watching this atm https://github.com/dotnet/corefx/pull/25216 and seeing what I can glean