MapView starts flickering/freezes/crashes after upgrade to 100.9

1787
6
03-26-2021 05:36 AM
o_pastukhov
New Contributor III

We've got a WPF application which uses ArcGIS Runtime 100.9. The application creates several graphic overlays for displaying map items. All the graphic overlays are created with the default rendering mode (Dynamic). We have a handler for the GeoViewTapped event which when called invokes MapView.IdentifyGraphicsOverlayAsync(overlay, e.Position, 0d, false, 1) on some graphic overlays in order to identify graphics and show callouts for them. In version 100.8 this worked with no issues. After upgrade to 100.9 we started noticing map flickering and/or crashes in the following scenario:

  1. Add an event handler for the GeoViewTapped event and call MapView.IdentifyGraphicsOverlayAsync(overlay, e.Position, 0d, false, 1) in it. Note that the tolerance parameter should be set to 0 and maximumResults should be 1. 
  2. Start the application with the map
  3. Press Ctrl+Alt+Del OR Win+L to open Windows Reboot or Login screens
  4. Press Cancel (for the Ctrl+Alt+Del screen) or enter a password for the Login screen to go back to the application
  5. Click somewhere on the map in order to fire the GeoViewTapped event
  6. Notice that upon the click the map view flickers and/or crashes the application. Sometimes it is needed to open one of those Windows system screens several times in order to observe this behavior. 

Probably this issue is related to another one described in this post https://community.esri.com/t5/arcgis-runtime-sdk-for-net/hit-testing-polygons-in-a-graphicsoverlay/t.... We tried to set maximumReults to 2 and this fixed the problem. Another option is to set rendering mode to Static for all the graphic overlays. This may  also be related to the changes made in version 100.9 regarding rendering optimizations.

Taken from the release notes: 

 At 100.9.0, graphics are rendered as efficiently as possible. When the Z-order of graphics isn't specified, graphics are rendered in the order they were added (the first one added is at the bottom, last on top), regardless of the geometry type. There are situations where graphics order may change to provide rendering optimizations. If the order of graphics within a graphics overlay is critical, the z-order for each graphic in the overlay must be explicitly set.

Here's the stack trace from the Windows Event Viewer:

 

 

Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
   at RuntimeCoreNet.GeneratedWrappers.CoreGeoView.CoreRT_GeoView_pulse(IntPtr, IntPtr ByRef)
   at RuntimeCoreNet.GeneratedWrappers.CoreGeoView.Pulse()
   at Esri.ArcGISRuntime.Internal.HostedSurfaceElement.CompositionTarget_Rendering(System.Object, System.EventArgs)
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(System.Object)
   at System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
   at Esri.ArcGISRuntime.Internal.HostedSurfaceElement.SurfaceBackgroundUiWorker(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart(System.Object)

 

 

 

Visual Studio Diagnostics Tools shows the following:

Screenshot_1.png

Information from the dump file:

Screenshot_2.png

Screenshot_3.png

System Information
------------------
Operating System: Windows 10 Enterprise 64-bit (10.0, Build 19041) (19041.vb_release.191206-1406)
Language: English (Regional Setting: English)
System Manufacturer: CI-EL_PC
System Model: Gigabyte_B250M-D3H
BIOS: BIOS Date: 07/06/17 15:34:27 Ver: 05.0000C (type: BIOS)
Processor: Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz (4 CPUs), ~3.0GHz
Memory: 16384MB RAM
Available OS Memory: 16272MB RAM
Page File: 16720MB used, 21055MB available
Windows Dir: C:\WINDOWS
DirectX Version: DirectX 12
DX Setup Parameters: Not found
User DPI Setting: 96 DPI (100 percent)
System DPI Setting: 96 DPI (100 percent)
DWM DPI Scaling: Disabled
Miracast: Available, with HDCP
Microsoft Graphics Hybrid: Not Supported
DirectX Database Version: 1.0.8
DxDiag Version: 10.00.19041.0546 64bit Unicode

The issue has also been reproduced on computers with other hardware specifications. The application was built in AnyCPU configuration. Please let me know if any other information would help to resolve the issue. Thanks!

 

6 Replies
MichaelBranscomb
Esri Frequent Contributor

Please can you try updating to the current release 100.10 and check if this is still reproducible?

0 Kudos
o_pastukhov
New Contributor III

Sure, we'll try and I'll let you know.

0 Kudos
o_pastukhov
New Contributor III

On version 100.10 we are getting the same issue. Please find the stack trace below.

Not Flagged	>	18752	0	Worker Thread	clr.dll thread	runtimecore.dll!00007ff9a6e78c5c
      ntdll.dll!NtWaitForMultipleObjects()
      KERNELBASE.dll!WaitForMultipleObjectsEx()
      KERNELBASE.dll!WaitForMultipleObjects()
      kernel32.dll!WerpReportFaultInternal()
      kernel32.dll!WerpReportFault()
      KERNELBASE.dll!UnhandledExceptionFilter()
      ntdll.dll!RtlUserThreadStart$filt$0()
      ntdll.dll!__C_specific_handler()
      ntdll.dll!RtlpExecuteHandlerForException()
      ntdll.dll!RtlDispatchException()
      ntdll.dll!KiUserExceptionDispatch()

// unhandled exception on invalid memory access
--->  runtimecore.dll!Esri_runtimecore::Rendering_engine::GPU_device_hal::get_texture_type(unsigned __int64)
      runtimecore.dll!Esri_runtimecore::Rendering_engine::Device::submit_readback_request_async(
			        class Esri_runtimecore::Rendering_engine::GPU_texture_view,
			        unsigned int,unsigned int,unsigned int,unsigned int)
      runtimecore.dll!Esri_runtimecore::Map_renderer::Entity_system::Rendering_system::hit_test(
			        class std::shared_ptr<class Esri_runtimecore::Rendering_engine::Device> const &,
			        struct Esri_runtimecore::Map_renderer::Entity_system::Rendering_system::Hit_test_context const &)
      runtimecore.dll!Esri_runtimecore::Map_renderer::Dynamic_layer_current::gpu_hit_test_(
			        class std::shared_ptr<class Esri_runtimecore::Rendering_engine::Device> const &,
			        class std::shared_ptr<class Esri_runtimecore::Map_renderer::Display_properties> const &,
			        class std::shared_ptr<class Esri_runtimecore::Map_renderer::Hit_testable::Hit_test_request_details> const &)
      runtimecore.dll!Esri_runtimecore::Map_renderer::Hit_testable::Hit_test_requests::execute_all(class std::function<void > const &,bool,bool)
      runtimecore.dll!Esri_runtimecore::Map_renderer::Dynamic_layer_current::draw_(
			        class std::shared_ptr<class Esri_runtimecore::Rendering_engine::Device> const &,
			        class std::shared_ptr<class Esri_runtimecore::Map_renderer::Display_properties> const &,
			        enum Esri_runtimecore::Map_renderer::Draw_candidates,
			        class Esri_runtimecore::Rendering_engine::GPU_frame_buffer_view const &)
      runtimecore.dll!Esri_runtimecore::Map_renderer::Dynamic_layer_current::draw(
			        class std::shared_ptr<class Esri_runtimecore::Rendering_engine::Device> const &,
			        class std::shared_ptr<class Esri_runtimecore::Map_renderer::Drawable::Render_properties> const &,
			        class std::shared_ptr<class Esri_runtimecore::Map_renderer::Display_properties> const &)
      runtimecore.dll!Esri_runtimecore::Map_renderer::Map::draw(class std::shared_ptr<class Esri_runtimecore::Rendering_engine::Device> const &)
      runtimecore.dll!Esri_runtimecore::Geo_views::Map_view::draw(class Esri_runtimecore::Geo_views::Device &)
      runtimecore.dll!RT_GeoView_draw()
      RuntimeCoreNet100_10.WPF.dll!Esri_runtimecore::Runtimecore_net::Dx_state_desktop::draw(void)
      runtimecore.dll!Esri_runtimecore::Common::Slot<void >::target_model<class <lambda_0007ed4defa6812d3eb93aa288d0e8f2> >::invoke(void const *,class Esri_runtimecore::Geo_model::File_request const &)
      runtimecore.dll!Esri_runtimecore::Common::Signal_detail::`anonymous namespace'::dispatch_to_node()
      runtimecore.dll!Esri_runtimecore::Common::Signal_detail::`anonymous namespace'::dispatch_notification()
      runtimecore.dll!Esri_runtimecore::Geo_views::Geo_view_draw_requested::draw_request_callback(void)
      runtimecore.dll!Esri_runtimecore::Map_renderer::Map::on_pulse_(void)
      runtimecore.dll!Esri_runtimecore::Geo_views::Map_view::pulse(void)
      runtimecore.dll!RT_GeoView_pulse()
      RuntimeCoreNet100_10.dll!CoreRT_GeoView_pulse()
      mscorlib.ni.dll!00007ffa191cb187()
      [Managed to Native Transition]
      Esri.ArcGISRuntime.dll!RuntimeCoreNet.GeneratedWrappers.CoreGeoView.Pulse()

// this is triggered by scaling change in Windows (dpi change)
--->  Esri.ArcGISRuntime.WPF.dll!Esri.ArcGISRuntime.Internal.HostedSurfaceElement.CompositionTarget_Rendering(object sender, System.EventArgs e)
      PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandlerCore(object resizedCompositionTarget)
      PresentationCore.dll!System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(object resizedCompositionTarget)
      WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs)
      WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler)
      WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl()
      WindowsBase.dll!MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(object obj)
      mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
      mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
      mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state)
      WindowsBase.dll!MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext executionContext, System.Threading.ContextCallback callback, object state)
      WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke()
      WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue()
      WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled)
      WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled)
      WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o)
      WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs)
      WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler)
      WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs)
      WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam)
      [Native to Managed Transition]
      user32.dll!UserCallWinProcCheckWow()
      user32.dll!DispatchMessageWorker()
      [Managed to Native Transition]
      WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame)
      Esri.ArcGISRuntime.WPF.dll!Esri.ArcGISRuntime.Internal.HostedSurfaceElement.SurfaceBackgroundUiWorker(object arg)
      mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
      mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
      mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state)
      mscorlib.dll!System.Threading.ThreadHelper.ThreadStart(object obj)
      [Native to Managed Transition]
      kernel32.dll!BaseThreadInitThunk()
      ntdll.dll!RtlUserThreadStart()
o_pastukhov
New Contributor III

Moreover, it seems like the crash occurs only when the app is running in compatibility mode "Application" (HIGHDPIAWARE). In other modes only flickering occurs upon MapView.IdentifyGraphicsOverlayAsync(overlay, e.Position, 0d, false, 1) method invocation.

MattGerginski
New Contributor

Can confirm that this is still an issue as of v100.12.

Can you please create an official bug to resolve this issue?

HalletBruestle
New Contributor II

This bug also occurs in ArcGisMap.MapView.IdentifyLayerAsync() in version v100.12.0, v100.15.1, and v200.0.0.

Reproduction:
1) Add a layer with map markers
2) Press Win + L to lock the computer
3) Log back in
4) Call MapView.IdentifyLayerAsync(layerName, screenPosition, 0, false, 1).
It will return a result with zero GeoElements and the screen flickers. Same issue occurs if maximumResults (last input parameter) is omitted from the call.

Change the call to MapView.IdentifyLayerAsync(layerName, screenPosition, 0, false, 2) and it will return a result with the intended GeoElement.