SetViewpointAsync causing random AccessViolationException

2091
5
01-24-2017 04:57 AM
CharlieMatherne1
New Contributor II

I'm running into the following randomly: System.AccessViolationException was unhandled Message: An unhandled exception of type 'System.AccessViolationException' occurred in WindowsBase.dll Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.    

A little background:

- I'm running Runtime v100.0

- The app is written using MVVM and Prism IoC

- There's a View (TwoDView) which has a MapView

- TwoDView has a ViewModel (TwoDViewModel) which navigates -- uses RequestNavigate(...) -- to a view (ThreeDView) which has SceneView

- ThreeDViewModel responds to the navigation and applies the camera (calling a controller, created to manage the SceneView using a WeakReference<>) passed via navigation parameters

- The controller calls SetViewpointCameraAsync  

There is also a back button in ThreeDView to allow going back to TwoDView for selecting another 3D area for inspection.  It seems multiple calls to SetViewpointCameraAsync is causing my issue...if I use SetViewpointCamera...no issue (it seems).  Any ideas??

Tags (1)
0 Kudos
5 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

Unfortunately this is a known issue in the v100.0 release. Apologies if the release notes were not quite as specific on this as they should have been (use of `setViewpointCamera` vs SetViewPointAsync).

"When calling setViewpointCamera on a timer with high animation speeds a crash may be encountered."

Release notes for 100.0—ArcGIS Runtime SDK for .NET | ArcGIS for Developers 

The issue is under consideration/investigation for addressing in the next release and we're also looking at ways we can expose a mechanism to cancel these async SetViewpoint... operations - that might help is this scenario.

Cheers

Mike

CharlieMatherne1
New Contributor II

Thanks Michael.  I failed to check the release notes.  In my case, the situation is stable.  But will be nice when the camera option is corrected -- Setting a Camera's distance (via constructor) causes issues when camera is applied to SceneView.

0 Kudos
ChadLeppanen
New Contributor II

Hi MBranscomb-esristaff,

Is there a timeline for when SetViewpointAsync will be available for the WPF SDK? I see that this issue is listed as addressed in the 100.1 release notes, but specifically for android and I'm still hitting this exception with the WPF SDK. Just curious when this will be rolled out to other languages as well.

Thank you.

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

It should have been addressed for all our .NET APIs in the 100.1 release (it was a bug in the underlying C++ codebase which is shared by both WPF and Android). 

Please can you share your code that shows this issue in WPF?

Cheers

Mike

0 Kudos
ChadLeppanen
New Contributor II

Hello again,

We're working on a sample application right now to isolate the use of the method. We'll verify that we continue to get access violation before passing it your way. Could take a while since the occurrence of the violation itself is random, and it generally takes several hours of running the application through functional simulation for us to hit it.

We are also gathering event viewer logs, and can provide dump files that might help, although they didn't really help us all too much.

Thanks!

Chad

0 Kudos