Exceptions get thrown from within StackTrace.cs while attempting to log a message sent from managed C++ code. It seems that the metadata for the stackframe information cannot be read properly. See attached screenshot.
One fix is to test contained objects for null before trying to access them. For example:
Change this kind of code:
builder.Append(f.GetMethod().DeclaringType.Name);.