I'm working on application that needs to be able to run on a high resolution monitor (2550x1440). One or our WPF controls uses the XamDockManager. When this control is displayed in size 2400x1200 or larger, a redocking action will cause the system to crash due to an out of memory exception.
To isolate the problem, I have created a test application with nothing but a XamDockManager sitting in a large MainWindow.xaml. I was able to reproduce the crash with the same exception signature.
The exception tracing is shown below. The test MainWindow.xaml is attached to this post. If anybody have ran into the same problem and found a fix for it, please share. Thank you.
--------------------------------------------------------------------------
Exception:
System.OutOfMemoryException: Insufficient memory to continue the execution of the program.
at System.Windows.Media.Composition.DUCE.Channel.SyncFlush() at System.Windows.Media.MediaContext.CompleteRender() at System.Windows.Interop.HwndTarget.OnResize() at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam) at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow) at System.Windows.Window.ShowHelper(Object booleanBox) at System.Windows.Window.Show() at Infragistics.Windows.Controls.ToolWindowHostWindow.Show(Boolean activate) at Infragistics.Windows.Controls.ToolWindow.ShowInToolWindowHostWindow(Boolean activate, Window owningWindow) at Infragistics.Windows.Controls.ToolWindow.ShowImpl(FrameworkElement owner, Boolean activate) at Infragistics.Windows.Controls.ToolWindow.Show(FrameworkElement owner, Boolean activate, Boolean preferPopup) at Infragistics.Windows.DockManager.DockManagerUtilities.ShowToolWindow(ToolWindow window, FrameworkElement owner, Boolean activate) at Infragistics.Windows.DockManager.Dragging.DragManager.ShowDropPreview(FrameworkElement owner, DropPreviewTabLocation location, Size size, HorizontalAlignment horzAlign, VerticalAlignment vertAlign, Double offsetX, Double offsetY, PaneLocation targetLocation) at Infragistics.Windows.DockManager.Dragging.DragManager.ShowDropPreview(FrameworkElement owner, DropPreviewTabLocation location, Nullable`1 sideForNone, Size size, Double offsetX, Double offsetY, PaneLocation targetLocation) at Infragistics.Windows.DockManager.Dragging.DragManager.ShowDropPreview(FrameworkElement owner, Dock side, Size size, Double offset, PaneLocation targetLocation) at Infragistics.Windows.DockManager.Dragging.AddToGroupActionBase.PerformAction(DragManager dragManager, Boolean isPreview) at Infragistics.Windows.DockManager.Dragging.DragManager.ProcessDragMove(IInputDeviceInfo e, Nullable`1 windowRect) at Infragistics.Windows.DockManager.Dragging.DragManager.ProcessDragMove(MouseEventArgs e) at Infragistics.Windows.DockManager.Dragging.DragManager.OnDragElementMouseMove(Object sender, MouseEventArgs e) at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.ContentElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.Run() at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window) at System.Windows.Application.Run()
----------------------------------------------
Hello Pink
I created a sample app using the file MainWindow.txt that you attached, but i am unable to reproduce this issue. Could you send information related to your environment (machine (XP/Vista...), RAM, CPU (Dual core etc.),32/64 bit, screen resolution, window transparency in your code, video driver, video card, video acceleration etc.) which would help reproduce this issue ? If you could attach a sample app that would be great.
Thanks
Ramesh
Hello Ramesh,
I took the suggestions from the previous reply and tried to reproduce the problem on 3 machines with different configurations. Here is what I found:
Machine 1: Windows XP 32-bit, SP3 - crash. (See attached Machine1.txt)
Machine 2: Windows 7 - no crash.
Machine 2: Windows XP running in a VM installed on Machine 2, 32-bit, SP3 - no crash.
Just a side note, Machine 2 is one of our machines in the server rack, so it is very powerful. Apparently, it didn't crashed there.
I have also tried to run the application on a different machine (Machine 3) with newer hardware configuration but the same OS (Windows XP 32bit SP3) and 4G RAM, that one too crashed.
So my conclusion is the problem may have something has to do with the hardware configuration. Maybe not enough memory, because the exception that I got was an out of memory exception.
Thank you.
Pink,
I wanted to follow up that the highest resolution I was able to test at was 1920x1080 which is less than the resolution of the monitors that you have. Since the issue is specific to two cards using the same video driver you should follow up with nVidia as the issue is only reproducible with those cards. Please post any resolution that nVidia may have here as well.
Let me know if you have any questions with this matter.
I am using InfragisticsWPF4.V11.1 dlls and XamDockManager crashes while draging the contentpane controls
[****START****][2012-02-28 13:08:25,455] [demo][1] Message: Object reference not set to an instance of an object.
Source: InfragisticsWPF4.DockManager.v11.1
TargetSite: Void ProcessDragMove(IInputDeviceInfo, System.Nullable`1[System.Windows.Rect])
StackTrace: at Infragistics.Windows.DockManager.Dragging.DragManager.ProcessDragMove(IInputDeviceInfo e, Nullable`1 windowRect)
at Infragistics.Windows.DockManager.Dragging.DragManager.ProcessDragMove(MouseEventArgs e)
at Infragistics.Windows.DockManager.Dragging.DragManager.OnDragElementMouseMove(Object sender, MouseEventArgs e)
at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.ContentElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at EFI.Monarch.FrameV2.App.Main() in E:\Monarch_CSV_Code\MS_VS_2010\Monarch.Client\EFI.Monarch.FrameV2\obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Hello,
There was an issue where dragging a retemplated ContentPane caused a NullReferenceException with the same stack trace. This exception was being thrown in that case because the retemplated ContentPane had a menu within the PaneHeaderPresenter that was getting focus and this also captured the mouse which took the focus away from the drag operation. Internally we addressed the exception in the control so that the drag operation is just terminated as there isn't anyway to know if capturing the mouse should be done.
In the case of the menu the solution was to modify the customized PaneHeaderPresenter so that the menu wouldn't take focus.
after removing custom template from contentpane and paneHeaderPresenter control getting the below exception
System.NullReferenceException occurred
Message=Object reference not set to an instance of an object.
Source=InfragisticsWPF4.DockManager.v11.1
StackTrace:
at Infragistics.Windows.DockManager.Dragging.DragManager.ProcessDragMove(IInputDeviceInfo e, Nullable`1 windowRect)
InnerException:
NarayanNB said: after removing custom template from contentpane and paneHeaderPresenter control getting the below exception
We tried running a sample using the original post's xaml on a system where the monitor's resolution is 2560x1600 and didn't reproduce the original issue nor the exception you are mentioning. Actually your issue sounds like it is different - as if something is happening during the drag processing and the drag is getting cancelled. The only such issue that comes to mind was a scenario where a contentpane contained a Menu and it was in the tab order so when the ContentPane was activated during the drag and focus was shifted to the first control that was the Menu which took mouse capture ending the drag. If that's not your issue then please provide a sample project that demonstrates the exception you are mentioning and we can look into it further.
Thank you for your update and it is good to know that everything is working. Regarding the issue that you saw, if the combo box took focus when you dropped it down, then it is likely that is was the same issue. We addressed the issue with the exception being thrown by the XamDockManager in a later service release though the fix only prevents the exception and the drag operation would end.
I was having the same problem. The problem ended up being a combo box inside the content pane that was opening and closing its drop down list in the combo box's loaded event. Whenever I would drag the pane that event would fire and cause the stack trace you mentioned. Handling the loaded event in the combo box was a working around for a different WPF bug. Andrew's post about the Menu causing the problem ended up pointing me in the right direction. We approached the Combo Box WPF bug in a different manner and everything works now.