Skip to content

Commit

Permalink
Add more filtering on TypeLoadException
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingosse committed Jan 13, 2025
1 parent 9d34d86 commit b1196d6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tracer/src/Datadog.Trace.Tools.dd_dotnet/CreatedumpCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -586,14 +586,18 @@ private unsafe void GenerateCrashReport(int pid, int? signal, int? crashThread)
"System.InvalidProgramException",
"System.MissingFieldException",
"System.MissingMemberException",
"System.BadImageFormatException",
"System.TypeLoadException"
"System.BadImageFormatException"
};

if (exceptionType.StartsWith("Datadog", StringComparison.OrdinalIgnoreCase) || suspiciousExceptionTypes.Contains(exceptionType))
{
isSuspicious = true;
}
else if (exceptionType == "System.TypeLoadException")
{
isSuspicious = exception.Message?.Contains("datadog", StringComparison.OrdinalIgnoreCase) == true
|| exception.StackTrace.Any(f => f.Method != null && IsMethodSuspicious(f.Method));
}
}

if (!isSuspicious)
Expand Down

0 comments on commit b1196d6

Please sign in to comment.