Select to view content in your preferred language

Bug - UI Freeze on view with map

2536
6
03-10-2021 05:50 AM
YaronAvraham
Emerging Contributor

Hi,

i'm using DevExpress 19.1 and arcgis runtime 100.9,  

using the dev express docking capability to detach part of the ui to a stand alone view, 

the entire app freezes when there is a loaded map inside the view i'm detaching

the main tread freezes with the following call stack :

 

YaronAvraham_0-1615383822788.png

 

none of my code exists in the call stack. 

 

any idea?

 

Adding the entire call stack of main thread -

Main Thread Main Thread WindowsBase.dll!System.Windows.Threading.DispatcherSynchronizationContext.WaitNot Flagged > 30340 1 Main Thread Main Thread WindowsBase.dll!System.Windows.Threading.DispatcherSynchronizationContext.Wait
[Managed to Native Transition]
WindowsBase.dll!System.Windows.Threading.DispatcherSynchronizationContext.Wait(System.IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout)
[Native to Managed Transition]
[Managed to Native Transition]
mscorlib.dll!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle waitableSafeHandle, long millisecondsTimeout, bool hasThreadAffinity, bool exitContext) Line 243
mscorlib.dll!System.Threading.WaitHandle.WaitOne(int millisecondsTimeout, bool exitContext) Line 194
Esri.ArcGISRuntime.WPF.dll!Esri.ArcGISRuntime.Internal.HostedSurfaceElement.CreateHostedElementOnWorkerThread()
Esri.ArcGISRuntime.WPF.dll!Esri.ArcGISRuntime.Internal.HostedSurfaceElement.StartRendering()
Esri.ArcGISRuntime.WPF.dll!Esri.ArcGISRuntime.UI.Controls.GeoView.StartRendering()
Esri.ArcGISRuntime.WPF.dll!Esri.ArcGISRuntime.UI.Controls.GeoView.OnLoadedAsync()
Esri.ArcGISRuntime.WPF.dll!Esri.ArcGISRuntime.UI.Controls.GeoView.MapSurfaceElement_Loaded(object sender, System.Windows.RoutedEventArgs e)
PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised)
PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args)
PresentationFramework.dll!System.Windows.BroadcastEventHelper.BroadcastEvent(System.Windows.DependencyObject root, System.Windows.RoutedEvent routedEvent)
PresentationFramework.dll!System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(object root)
PresentationCore.dll!MS.Internal.LoadedOrUnloadedOperation.DoWork()
PresentationCore.dll!System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
PresentationCore.dll!System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandlerCore(object resizedCompositionTarget)
PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandler(object resizedCompositionTarget)
PresentationCore.dll!System.Windows.Interop.HwndTarget.OnResize()
PresentationCore.dll!System.Windows.Interop.HwndTarget.HandleMessage(MS.Internal.Interop.WindowMessage msg, System.IntPtr wparam, System.IntPtr lparam)
PresentationCore.dll!System.Windows.Interop.HwndSource.HwndTargetFilterMessage(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]
[Managed to Native Transition]
WindowsBase.dll!MS.Win32.HwndSubclass.DefWndProcWrapper(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam)
[Native to Managed Transition]
[Managed to Native Transition]
WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam)
[Native to Managed Transition]
[Managed to Native Transition]
PresentationFramework.dll!System.Windows.Window.Flush()
PresentationFramework.dll!System.Windows.Window.HwndStyleManager.System.IDisposable.Dispose()
PresentationFramework.dll!System.Windows.Window.CreateSourceWindow(bool duringShow)
PresentationFramework.dll!System.Windows.Window.ShowHelper(object booleanBox)
DevExpress.Xpf.Docking.v19.1.dll!DevExpress.Xpf.Docking.VisualElements.FloatingWindowPresenter.UpdateIsOpenCore(bool isOpen)
DevExpress.Xpf.Core.v19.1.dll!DevExpress.Xpf.Core.BaseFloatingContainer.UpdateContainer(object content)
DevExpress.Xpf.Core.v19.1.dll!DevExpress.Xpf.Core.BaseFloatingContainer..cctor.AnonymousMethod__7_0(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e)
WindowsBase.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)
PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)
WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args)
WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType)
PresentationFramework.dll!System.Windows.StyleHelper.ApplyTemplatedParentValue(System.Windows.DependencyObject container, MS.Internal.FrameworkObject child, int childIndex, ref MS.Utility.FrugalStructList<System.Windows.ChildRecord> childRecordFromChildIndex, System.Windows.DependencyProperty dp, System.Windows.FrameworkElementFactory templateRoot)
PresentationFramework.dll!System.Windows.StyleHelper.InvalidatePropertiesOnTemplateNode(System.Windows.DependencyObject container, MS.Internal.FrameworkObject child, int childIndex, ref MS.Utility.FrugalStructList<System.Windows.ChildRecord> childRecordFromChildIndex, bool isDetach, System.Windows.FrameworkElementFactory templateRoot)
PresentationFramework.dll!System.Windows.FrameworkTemplate.InvalidatePropertiesOnTemplate(System.Windows.DependencyObject container, object currentObject)
PresentationFramework.dll!System.Windows.FrameworkTemplate.HandleBeforeProperties(object createdObject, ref System.Windows.DependencyObject rootObject, System.Windows.DependencyObject container, System.Windows.FrameworkElement feContainer, System.Windows.Markup.INameScope nameScope)
PresentationFramework.dll!System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent.AnonymousMethod__2(object sender, System.Xaml.XamlObjectEventArgs args)
System.Xaml.dll!System.Xaml.XamlObjectWriter.OnBeforeProperties(object value)
System.Xaml.dll!System.Xaml.XamlObjectWriter.Logic_CreateAndAssignToParentStart(MS.Internal.Xaml.Context.ObjectWriterContext ctx)
System.Xaml.dll!System.Xaml.XamlObjectWriter.WriteEndObject()
PresentationFramework.dll!System.Windows.FrameworkTemplate.LoadTemplateXaml(System.Xaml.XamlReader templateReader, System.Xaml.XamlObjectWriter currentWriter)
PresentationFramework.dll!System.Windows.FrameworkTemplate.LoadTemplateXaml(System.Xaml.XamlObjectWriter objectWriter)
PresentationFramework.dll!System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(System.Windows.DependencyObject container, System.Windows.Markup.IComponentConnector componentConnector, System.Windows.Markup.IStyleConnector styleConnector, System.Collections.Generic.List<System.Windows.DependencyObject> affectedChildren, System.Windows.UncommonField<System.Collections.Hashtable> templatedNonFeChildrenField)
PresentationFramework.dll!System.Windows.FrameworkTemplate.LoadContent(System.Windows.DependencyObject container, System.Collections.Generic.List<System.Windows.DependencyObject> affectedChildren)
PresentationFramework.dll!System.Windows.StyleHelper.ApplyTemplateContent(System.Windows.UncommonField<System.Collections.Specialized.HybridDictionary[]> dataField, System.Windows.DependencyObject container, System.Windows.FrameworkElementFactory templateRoot, int lastChildIndex, System.Collections.Specialized.HybridDictionary childIndexFromChildID, System.Windows.FrameworkTemplate frameworkTemplate)
PresentationFramework.dll!System.Windows.FrameworkTemplate.ApplyTemplateContent(System.Windows.UncommonField<System.Collections.Specialized.HybridDictionary[]> templateDataField, System.Windows.FrameworkElement container)
PresentationFramework.dll!System.Windows.FrameworkElement.ApplyTemplate()
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize)
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize)
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureCell(int cell, bool forceInfinityV)
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureCellsGroup(int cellsHead, System.Windows.Size referenceSize, bool ignoreDesiredSizeU, bool forceInfinityV, out bool hasDesiredSizeUChanged)
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size constraint)
DevExpress.Xpf.Docking.v19.1.dll!DevExpress.Xpf.Docking.VisualElements.GroupPanel.MeasureOverride(System.Windows.Size constraint)
DevExpress.Xpf.Docking.v19.1.dll!DevExpress.Xpf.Docking.VisualElements.FloatingItemsPanel.MeasureOverride(System.Windows.Size availableSize)
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize)
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize)
PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayout()
DevExpress.Xpf.Docking.v19.1.dll!DevExpress.Xpf.Docking.DockLayoutManager.Update(bool shouldUpdateLayout)
DevExpress.Xpf.Docking.v19.1.dll!DevExpress.Xpf.Docking.UpdateBatch.Dispose()
DevExpress.Xpf.Docking.v19.1.dll!DevExpress.Xpf.Docking.DockControllerExtensions.Float(DevExpress.Xpf.Docking.IDockController controller, DevExpress.Xpf.Docking.BaseLayoutItem item, System.Windows.Rect floatBounds)
DevExpress.Xpf.Docking.v19.1.dll!DevExpress.Xpf.Docking.Platform.FloatingHelper.GetFloatingView(DevExpress.Xpf.Layout.Core.ILayoutElement element)
DevExpress.Xpf.Layout.v19.1.Core.dll!DevExpress.Xpf.Layout.Core.SupportFloatingListener.GetFloatingView(DevExpress.Xpf.Layout.Core.ILayoutElement element)
DevExpress.Xpf.Docking.v19.1.dll!DevExpress.Xpf.Docking.Platform.LayoutViewClientDraggingListener.InitFloating(DevExpress.Xpf.Layout.Core.ILayoutElement element, System.Windows.Point point)
DevExpress.Xpf.Docking.v19.1.dll!DevExpress.Xpf.Docking.Platform.LayoutViewClientDraggingListener.OnDrop(System.Windows.Point point, DevExpress.Xpf.Layout.Core.ILayoutElement element)
DevExpress.Xpf.Layout.v19.1.Core.dll!DevExpress.Xpf.Layout.Core.Dragging.DragServiceState.DoDrop(DevExpress.Xpf.Layout.Core.IView view, System.Windows.Point point, DevExpress.Xpf.Layout.Core.OperationType type)
DevExpress.Xpf.Layout.v19.1.Core.dll!DevExpress.Xpf.Layout.Core.Dragging.ClientDragServiceStateBase.ProcessMouseUp(DevExpress.Xpf.Layout.Core.IView view, System.Windows.Point point)
DevExpress.Xpf.Layout.v19.1.Core.dll!DevExpress.Xpf.Layout.Core.Dragging.DragService.ProcessMouseCore(DevExpress.Xpf.Layout.Core.IView processor, System.Windows.Point screenPoint, DevExpress.Xpf.Layout.Core.Platform.MouseEventType eventType, DevExpress.Xpf.Layout.Core.Platform.MouseEventArgs e)
DevExpress.Xpf.Layout.v19.1.Core.dll!DevExpress.Xpf.Layout.Core.Dragging.DragService.ProcessMouseOverride(DevExpress.Xpf.Layout.Core.IView view, DevExpress.Xpf.Layout.Core.Platform.MouseEventType eventType, DevExpress.Xpf.Layout.Core.Platform.MouseEventArgs ea)
DevExpress.Xpf.Layout.v19.1.Core.dll!DevExpress.Xpf.Layout.Core.UIService.ProcessMouse(DevExpress.Xpf.Layout.Core.IView view, DevExpress.Xpf.Layout.Core.Platform.MouseEventType eventType, DevExpress.Xpf.Layout.Core.Platform.MouseEventArgs ea)
DevExpress.Xpf.Layout.v19.1.Core.dll!DevExpress.Xpf.Layout.Core.Platform.ViewAdapter.ProcessMouseEvent(DevExpress.Xpf.Layout.Core.IView view, DevExpress.Xpf.Layout.Core.Platform.MouseEventType eventType, DevExpress.Xpf.Layout.Core.Platform.MouseEventArgs ea)
DevExpress.Xpf.Layout.v19.1.Core.dll!DevExpress.Xpf.Layout.Core.Platform.BaseView.OnMouseEvent(DevExpress.Xpf.Layout.Core.Platform.MouseEventType eventType, DevExpress.Xpf.Layout.Core.Platform.MouseEventArgs ea)
DevExpress.Xpf.Docking.v19.1.dll!DevExpress.Xpf.Docking.Platform.MouseEventSubscriber.RootUIElementMouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target)
PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs)
PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised)
PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args)
PresentationCore.dll!System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs args)
PresentationCore.dll!System.Windows.Input.InputManager.ProcessStagingArea()
PresentationCore.dll!System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs input)
PresentationCore.dll!System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport inputReport)
PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.ReportInput(System.IntPtr hwnd, System.Windows.Input.InputMode mode, int timestamp, System.Windows.Input.RawMouseActions actions, int x, int y, int wheel)
PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.FilterMessage(System.IntPtr hwnd, MS.Internal.Interop.WindowMessage msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled)
PresentationCore.dll!System.Windows.Interop.HwndSource.InputFilterMessage(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]
[Managed to Native Transition]
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame)
PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore)
PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window)

 

 

 

0 Kudos
6 Replies
dotMorten_esri
Esri Notable Contributor

When you hit the breakpoint, could you go to Debug -> Save Dump As... and share the dump that's being generated?

 

Also if you have a small app that reproduces the problem, I'd love for you to share it.

0 Kudos
dotMorten_esri
Esri Notable Contributor

I do believe I have a workaround for you: Try adding this in your application startup:
AppContext.SetSwitch("Switch.Esri.ArcGISRuntime.DisableSecondaryUIThread", true);

 

(But if you can share a reproducer, I'd still like to have it so we can get to the bottom of it)

YaronAvraham
Emerging Contributor

Thanks, looks like the DisableSecondaryUIThread flag did the job, can i play with this flag while the program is running? i want to attach to OnBeforeDocking action  and set it to true, and after docking action is finished set it to false again, is there a way i can test that secondery ui thread is really on?

(I'll try to reproduce this issue in a side app)

 

Thanks!

 

0 Kudos
YaronAvraham
Emerging Contributor

looks like i cannot use this flag on before docking event.

for now i'll have to either turn it on startup 

or use a workaround - remove the UI element that contains the map view from the xaml on before docking event, and put it back into the UI after the action of docking is finished, i really hope you could solve this issue in future releases.

0 Kudos
dotMorten_esri
Esri Notable Contributor

Yes you have to set this setting prior to creating the MapView control - it cannot be set on-the-fly.
We would love to solve it, and a small reproducer would go a long way for us to address it.

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

We suspect there's a good chance that this issue was resolved in the recent v100.12 release (when fixing BUG-000140934 The MapView window created by a custom control is not responding (https://developers.arcgis.com/net/reference/release-notes/100.12/#issues-resolved)

 

Thanks

0 Kudos