Open BTony95 opened 1 year ago
Hi,
As we don't have a line number in the stacktrace, would you mind telling us which version of OpenKit .NET is used in your application?
Thanks!
Hello,
No line numbers were left out in the stacktrace. That is why we indeed could use your help to fix the issue. Here is a screenshot of the specifics.
Okay so you are using the Main branch, as there is no 3.2 release. We have got an idea about the issue and will try to create a fix. I will notify you again here when work is done.
Did you directly use the main branch here? Or did you add some modifications? (Stacktrace also mentions extensions?) Because I went through the whole code again and it is very hard to explain why there is a null reference.
We are indeed using it with a fork of the master branch.
No adjustments were made to the code on our side. The only adjustments we made was to compile with .net48 and .net7
We will try rebuilding it with the official version and configurations. Did you already find some other plausible root causes for this issue?
I went through the code with some of my colleagues but we feel like it is impossible to have a NullReference in there. We first thought that the childs might contain null, but all add calls actually insert a new instance. So only beacon or parent might be an option, but also there it seems to be impossible as they get inserted in the constructor.
So the crash is still appearing constantly? So the idea of using the official version might help show us if the crash disappears?
EDIT: Do you mean .net8? Because 7 is actually added. (8 is already on the agenda)
Hi,
The error still occurs and one of our devs went through the code. According to him [https://github.com/Dynatrace/openkit-dotnet/blob/3836c412cb857299d956f76d5f4338bcc57807e7/src/Dynatrace.OpenKit/Core/Objects/BaseAction.cs#L390C1-L390C70] could be an explanation. A concurrent read is not locked with other writes.
Could you have a look on your side?
We had internal discussions and we agree on your finding. We will enclose other calls as well into the lock (Other usages of retrieving the list of child objects). We will try to push version 3.2.1 by tomorrow.
Describe the bug We run a C# application where we use Dynatrace as a logging/tracing system. We have noticed that some users experience a crash with stacktrace below without any clue why this happens.
To Reproduce The crash appears at random and we can't force a reproduce unfortunately.
Expected behavior We do not expect a user session to crash by this issue. We want to be able to handle this issue in the background without any issues seen by the enduser
Stacktrace (Slightly redacted)
Exception information
ThreadIdentity: ClaimsPrincipal: UserName: XXXXXXX
1) System.NullReferenceException Message: Object reference not set to an instance of an object. HResult: 80004003 Data: System.Object:
StackTrace at Dynatrace.OpenKit.Core.Objects.BaseAction.DoLeaveAction(Boolean discardData) at Dynatrace.OpenKit.Core.Objects.BaseAction.LeaveAction() at NinjaProject.Dynatrace.Extensions.UserTrackingTelemetry.Dispose() in D:\BLD1_work\44\s\NinjaProject.Dynatrace.Extensions\Logic\UserTrackingTelemetry.cs:line 88 at System.Threading.Tasks.DynatraceTaskExtensions.d__1`1.MoveNext() in D:\BLD1_work\44\s\NinjaProject.Dynatrace.Extensions\Extensions\DynatraceTaskExtensions.cs:line 37
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)