Intermittent Native Crash During Concurrent Long Running Streaming (VMS 2025 R2, VMS 2025 R1, VMS 2024 R2 and SDK 24.2.2)

We are experiencing an intermittent native crash in our host service that uses the Milestone MIP SDK. The crash occurs during long-running tests that involve concurrent streaming (20+ streams) within our service. The evidence points to a race condition causing memory corruption within the underlying native toolkit.

Problem Details:

  • Crash Signature (from dump): um:invalid_pointer_write_avrf_c0000005_vcruntime140.dll!memcpy.
  • Interpretation: The crash occurred during a standard memory copy operation in the C++ runtime, indicating that an invalid or corrupted memory address was accessed.
  • Triggering Context: The crash is triggered by a PInvoke call originating from a thread running an internal SDK method (BaseLiveSource.PollThread)

Call Path from Dump:

00000063fa8fdee8 00007ff81514fa44 [InlinedCallFrame: 00000063fa8fdee8] 
00000063fa8fdee8 00007ff7a84027c1 [InlinedCallFrame: 00000063fa8fdee8] 
00000063fa8fdec0 00007ff7a84027c1 DomainBoundILStubClass.IL_STUB_PInvoke(IntPtr, std.basic_string,std::allocator >*, std.basic_string,std::allocator >*)
00000063fa8fdfa0 00007ff7a8421b82 VideoOS.Toolkit.SourceToolkit.UpdateConfiguration(System.String, System.String)
00000063fa8fe1e0 00007ff7a84219c7 VideoOS.Platform.Common.InternalMediaServiceCommon.SetNewToken(System.Object, System.String)
00000063fa8fe210 00007ff7a83f5d8a VideoOS.Platform.Live.BaseLiveSource`2[[System.__Canon, mscorlib],[System.__Canon, mscorlib]].PollThread()
00000063fa8fe2b0 00007ff8051cdf12 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) [f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs @ 980]
00000063fa8fe380 00007ff8051cdd95 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) [f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs @ 928]
00000063fa8fe3b0 00007ff8051cdd65 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) [f:\dd\ndp\clr\src\BCL\system\threading\executioncontext.cs @ 917]
00000063fa8fe400 00007ff805273e85 System.Threading.ThreadHelper.ThreadStart() [f:\dd\ndp\clr\src\BCL\system\threading\thread.cs @ 111]
00000063fa8fe650 00007ff807206953 [GCFrame: 00000063fa8fe650] 
00000063fa8fe9b0 00007ff807206953 [DebuggerU2MCatchHandlerFrame: 00000063fa8fe9b0]

Environment:

  • Installed VMS Versions: XProtect Corporate 2025 R2 (25.2.1), 2025 R1 (25.1.2) & 2024 R2 (24.2.3)
  • SDK Component Version: 24.2.2
  • Host Service: C++ host using a C# wrapper consuming the MIP SDK.

Request:

We need Milestone’s expertise to analyze this crash. Could you confirm if this is a known issue, especially concerning the native toolkit and operations involving internal methods like PollThread, SetNewToken, and UpdateConfiguration?

Are there any relevant fixes available in component versions later than 24.2.2?

Please create a crash dump and make it available to us at Milestone Support. Analyzing the crash dump it is possible that we can find the cause of the crash and possibly also a solution.

Please set this option just after initializing the SDK

EnvironmentManager.Instance.EnvironmentOptions[“ToolkitFork”] = “No”;

Please test with this and if you see new crashes please gather a new crash dump.