Crash when app is idle

Bars for Windows Forms Forum

Posted 12 years ago by Marianne
I've had a couple users report a problem when the app is sitting idle for a long time (a day or two). When trying to restore the app from a minimized state the following exception occurs. Can you think of anything that could cause this?

System.ArgumentException: IComparer (or the IComparable methods it relies upon) did not return zero when Array.Sort called x. CompareTo(x). x: 'ActiproSoftware.UIStudio.Bar.BarButtonLink' x's type: 'BarButtonLink' The IComparer: 'ActiproSoftware.UIStudio.Bar.DockableToolBarRow+a'.
at System.Array.SorterObjectArray.QuickSort(Int32 left, Int32 right)
at System.Array.SorterObjectArray.QuickSort(Int32 left, Int32 right)
at System.Array.Sort(Array keys, Array items, Int32 index, Int32 length, IComparer comparer)
at System.Collections.ArrayList.Sort(Int32 index, Int32 count, IComparer comparer)
at System.Collections.ArrayList.Sort(IComparer comparer)
at ActiproSoftware.UIStudio.Bar.BarCommandLinkCollection.a(IComparer A_0)
at ActiproSoftware.UIStudio.Bar.DockableToolBarRow.a(Boolean A_0)
at ActiproSoftware.UIStudio.Bar.DockableToolBarRow.MeasureCore(Graphics g, Size availableSize)
at ActiproSoftware.WinUICore.UIElement.Measure(Graphics g, Size availableSize)
at ActiproSoftware.WinUICore.UIControl.MeasureCore(Graphics g, Size availableSize)
at ActiproSoftware.WinUICore.UIControl.Measure(Graphics g, Size availableSize)
at ActiproSoftware.WinUICore.UIControl.UpdateLayout()
at ActiproSoftware.WinUICore.UIControl.Invalidate(InvalidationLevels levels, InvalidationTypes types)
at ActiproSoftware.WinUICore.UIControl.OnLayout(LayoutEventArgs e)
at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement affectedElement, String affectedProperty)
at System.Windows.Forms.Layout.LayoutTransaction.DoLayout(IArrangedElement elementToLayout, IArrangedElement elementCausingLayout, String property)
at System.Windows.Forms.Control.OnResize(EventArgs e)
at ActiproSoftware.WinUICore.UIControl.OnResize(EventArgs e)
at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Control.UpdateBounds()
at System.Windows.Forms.Control.WmWindowPosChanged(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at ActiproSoftware.UIStudio.Bar.BarDockArea.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

------------------------------- Marianne

Comments (3)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Marianne,

We have another customer report this recently too and from looking at the code, I'm unsure how it possibly is happening. But what I did anyhow was add a check like this as the first thing in the Compare:
if (x == y)
    return 0;
That should prevent this from happening. This will be in the next maintenance release, which should be relatively soon.

Actipro Software Support

Posted 12 years ago by Marianne
I'm unable to repro it myself but hopefully this should work. Thanks much!

------------------------------- Marianne

Posted 12 years ago by Kasper
Just for your information, I've had a user report the exact same problem, although the application had only been idle for like an hour or so. I'm happy to see that this should be fixed for next release :)
The latest build of this product (v2018.1 build 0341) was released 6 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.