Select to view content in your preferred language

Application Locks Up when displaying Mapview in WPF Tabview

2550
10
02-15-2021 10:08 PM
ThomasMcMahon
Emerging Contributor

Hi,

We're looking to update our software from 100.4 to 100.10 runtime in order to use the new locator type, but we are having an issue where if the mapview is contained within a tabview, and the tab is changed while the map is in a certain rendering state, the application will lock up for exactly 1 minute and then continue without an exception. When paused under debugger while the application is in this state, the main thread is stuck at: RuntimeCoreNet.CoreDxDevice.Pause.

Through some trial and error, we have found that this only occurs when street labels are enabled.

I can recreate this with runtimes 100.5-100.10 but not 100.4. The application uses WPF. I have included a snippet of the stack trace for the pause call

0 Kudos
10 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

Nice troubleshooting so far.

A couple of questions:

Thanks

0 Kudos
ThomasMcMahon
Emerging Contributor

Unfortunately don't have any more information on the rendering state, just that it doesn't occur all the time. no specific action (zoom, pan) is being performed on the map when it happens. I have attached the additional call stack with runtime symbols and native debugging.

0 Kudos
ThomasMcMahon
Emerging Contributor

Any ideas for solving this issue?

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

Apologies, I didn't notice you're using the ArcGIS Runtime WPF MapView control within the UWP TabView. Can you share a small standalone repro to show how you've implemented that?

Thanks

0 Kudos
ThomasMcMahon
Emerging Contributor

Sorry, meant the WPF TabControl

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Incrementally over the last few years we've resolved several issues related to use of the TabControl, typically for workflows involving frequent tab changes. I re-ran various tests and was unfortunately unable to reproduce any issues with version 100.10. 

The callstack indicates the rendering was paused, which happens when the MapView is unloaded / removed from the visual tree. Does your application have any code running in response to a tab change, for example when any of the tab control events are raised? 

0 Kudos
ThomasMcMahon
Emerging Contributor

we do have an event for if the selected tab changes, and the map tab will collapse the map view if it is no longer visible to improve performance. The issue still occurs if the collapse is present or not.

0 Kudos
ServisZLD
Emerging Contributor

This hang occured for us also, sdk also started allocating huge amounts of memory during the hang, we are using version 100.12.

callstack:

[Managed to Native Transition]
> Esri.ArcGISRuntime.WPF.dll!RuntimeCoreNet.CoreDxDevice.Pause(RuntimeCoreNet.GeneratedWrappers.CoreGraphicsHardwareResources resources) Unknown
Esri.ArcGISRuntime.WPF.dll!Esri.ArcGISRuntime.UI.Controls.GeoView.StopRendering() Unknown
Esri.ArcGISRuntime.WPF.dll!Esri.ArcGISRuntime.UI.Controls.GeoView.OnUnloadedAsync() Unknown
Esri.ArcGISRuntime.WPF.dll!Esri.ArcGISRuntime.UI.Controls.GeoView.MapSurfaceElement_Unloaded(object sender, System.Windows.RoutedEventArgs e) Unknown
PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) Unknown
PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) Unknown
PresentationFramework.dll!System.Windows.BroadcastEventHelper.BroadcastEvent(System.Windows.DependencyObject root, System.Windows.RoutedEvent routedEvent) Unknown
PresentationFramework.dll!System.Windows.BroadcastEventHelper.BroadcastUnloadedEvent(object root) Unknown
PresentationCore.dll!MS.Internal.LoadedOrUnloadedOperation.DoWork() Unknown
PresentationCore.dll!System.Windows.Media.MediaContext.FireLoadedPendingCallbacks() Unknown
PresentationCore.dll!System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() Unknown
PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandlerCore(object resizedCompositionTarget) Unknown
PresentationCore.dll!System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(object resizedCompositionTarget) Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Unknown
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl() Unknown
WindowsBase.dll!MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(object obj) Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
WindowsBase.dll!MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke() Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue() Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown
WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown
WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs) Unknown
WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) Unknown
[Native to Managed Transition]
[Managed to Native Transition]
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) Unknown
PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore) Unknown
PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window) Unknown

0 Kudos
ServisZLD
Emerging Contributor

Also there was a worker thread with this callstack:

> Esri.ArcGISRuntime.dll!RuntimeCoreNet.GeneratedWrappers.CoreGeoView.SetViewpointChangedCallback(RuntimeCoreNet.GeneratedWrappers.ICoreCallback_GeoView_ViewpointChanged callback) Unknown
Esri.ArcGISRuntime.dll!RuntimeCoreNet.GeneratedWrappers.CoreMapView.DisposeCallbacks() Unknown
Esri.ArcGISRuntime.dll!RuntimeCoreNet.GeneratedWrappers.CoreWrapperBase.~CoreWrapperBase() Unknown
Esri.ArcGISRuntime.dll!RuntimeCoreNet.GeneratedWrappers.CoreMapView.~CoreMapView() Unknown

0 Kudos