Bug #55304 Deleting / creating EER diagrams causes a crash.
Submitted: 15 Jul 2010 21:35 Modified: 30 Sep 2010 12:26
Reporter: Mark Gants Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:5.2.25, 5.2.26, 5.2.28 OS:Windows (Windows 7)
Assigned to: Mike Lischke CPU Architecture:Any

[15 Jul 2010 21:35] Mark Gants
Description:
Repeatedly creating and deleting EER diagrams causes Workbench to crash.

How to repeat:
1. Create a few tables.
2. Link tables with foreign keys.
3. Select Model > Create Diagram from Catalog Objects.
4. Close diagram.
5. Delete the diagram.
6. Repeat the whole process a few times.
7. Workbench will crash with an "out of index" error.
[19 Jul 2010 12:04] MySQL Verification Team
I couldn't repeat on Windows Vista Home Premium 64-bits.
[20 Jul 2010 8:44] Roel Van de Paar
Verified as described on Win7 x64 HP. Tables have to be created in data modeling view. Adding backtrace shortly.
[20 Jul 2010 8:45] Roel Van de Paar
Crash

Attachment: WB_bug_55304.png (image/png, text), 49.09 KiB.

[20 Jul 2010 8:50] Roel Van de Paar
Exception = System.ArgumentOutOfRangeException
Message = Index must be within the bounds of the List.
Parameter name: index
FullText = System.ArgumentOutOfRangeException: Index must be within the bounds of the List.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.Insert(Int32 index, T item)
   at Aga.Controls.Tree.TreeNodeAdv.NodeCollection.InsertItem(Int32 index, TreeNodeAdv item)
   at System.Collections.ObjectModel.Collection`1.Add(T item)
   at Aga.Controls.Tree.TreeViewAdv.AddNode(TreeNodeAdv parent, Int32 index, TreeNodeAdv node)
   at Aga.Controls.Tree.TreeViewAdv.ReadChilds(TreeNodeAdv parentNode, Boolean performFullUpdate)
   at Aga.Controls.Tree.TreeViewAdv._model_StructureChanged(Object sender, TreePathEventArgs e)
   at MySQL.Grt.GrtListModel.OnStructureChanged(TreePathEventArgs args)
   at MySQL.Grt.GrtListModel.RefreshModel()
   at MySQL.GUI.Workbench.UndoHistoryForm.UpdateHistoryTree()
   at MySQL.GUI.Workbench.UndoHistoryForm.invokeRefresh(NodeId node, Int32 oldCount)
   at MySQL.Grt.RunWrappedDelegate2<void\,void\,bec::NodeId\,MySQL::Grt::NodeId ^\,int\,int\,MySQL::Grt::DelegateSlot2<void\,void\,bec::NodeId\,MySQL::Grt::NodeId ^\,int\,int>::ManagedDelegate>.native_callback(NodeId* a1, Int32* a2)
   at sigc.pointer_functor2<bec::NodeId const &,int const &,void>.()(pointer_functor2<bec::NodeId const \&\,int const \&\,void>* , NodeId* _A_a1, Int32* _A_a2)
   at sigc.adaptor_functor<sigc::pointer_functor2<bec::NodeId const &,int const &,void> >.operator()<struct bec::NodeId const &,int const &>(adaptor_functor<sigc::pointer_functor2<bec::NodeId const \&\,int const \&\,void> >* , NodeId* _A_arg1, Int32* _A_arg2)
   at sigc.internal.slot_call2<sigc::pointer_functor2<bec::NodeId const &,int const &,void>,void,bec::NodeId const &,int const &>.call_it(slot_rep* rep, NodeId* a_1, Int32* a_2)
   at sigc.slot2<void,bec::NodeId const &,int const &>.()(slot2<void\,bec::NodeId const \&\,int const \&>* , NodeId* _A_a1, Int32* _A_a2)
   at sigc.adaptor_functor<sigc::slot<void,bec::NodeId const &,int const &,sigc::nil,sigc::nil,sigc::nil,sigc::nil,sigc::nil> >.operator()<struct bec::NodeId const &,int const &>(adaptor_functor<sigc::slot<void\,bec::NodeId const \&\,int const \&\,sigc::nil\,sigc::nil\,sigc::nil\,sigc::nil\,sigc::nil> >* , NodeId* _A_arg1, Int32* _A_arg2)
   at sigc.internal.slot_call2<sigc::slot<void,bec::NodeId const &,int const &,sigc::nil,sigc::nil,sigc::nil,sigc::nil,sigc::nil>,void,bec::NodeId,int>.call_it(slot_rep* rep, NodeId* a_1, Int32* a_2)
[20 Jul 2010 11:32] Roel Van de Paar
Full backtrace (scroll down and check analyze -v output and backtrace of all threads below that)

Attachment: trace_details.txt (text/plain), 77.67 KiB.

[22 Jul 2010 2:17] Alfredo Kojima
Looks like Windows specific from backtrace and couldn't repeat in Mac
[27 Jul 2010 13:14] Mike Lischke
Fixed in repository.
[30 Jul 2010 16:33] Johannes Taxacher
getting this now when trying to verify the fix:

Exception = System.InvalidOperationException
Message = Object is currently in use elsewhere.
FullText = System.InvalidOperationException: Object is currently in use elsewhere.
   at System.Drawing.Graphics.MeasureString(String text, Font font, SizeF layoutArea, StringFormat stringFormat)
   at System.Drawing.Graphics.MeasureString(String text, Font font)
   at Aga.Controls.Tree.NodeControls.BaseTextControl.GetLabelSize(TreeNodeAdv node, DrawContext context, String label) in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\Aga.Controls\Tree\NodeControls\BaseTextControl.cs:line 127
   at Aga.Controls.Tree.NodeControls.BaseTextControl.GetLabelSize(TreeNodeAdv node, DrawContext context) in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\Aga.Controls\Tree\NodeControls\BaseTextControl.cs:line 115
   at Aga.Controls.Tree.NodeControls.BaseTextControl.MeasureSize(TreeNodeAdv node, DrawContext context) in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\Aga.Controls\Tree\NodeControls\BaseTextControl.cs:line 110
   at Aga.Controls.Tree.NodeControls.NodeControl.GetActualSize(TreeNodeAdv node, DrawContext context) in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\Aga.Controls\Tree\NodeControls\NodeControl.cs:line 123
   at Aga.Controls.Tree.TreeViewAdv.<GetNodeControls>d__7.MoveNext() in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\Aga.Controls\Tree\TreeViewAdv.cs:line 501
   at Aga.Controls.Tree.TreeViewAdv.GetNodeBounds(IEnumerable`1 nodeControls) in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\Aga.Controls\Tree\TreeViewAdv.cs:line 811
   at Aga.Controls.Tree.TreeViewAdv.GetNodeWidth(TreeNodeAdv node) in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\Aga.Controls\Tree\TreeViewAdv.cs:line 797
   at Aga.Controls.Tree.TreeViewAdv.CreateRowMap() in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\Aga.Controls\Tree\TreeViewAdv.cs:line 780
   at Aga.Controls.Tree.TreeViewAdv.UnsafeFullUpdate() in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\Aga.Controls\Tree\TreeViewAdv.cs:line 567
   at Aga.Controls.Tree.TreeViewAdv.FullUpdate() in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\Aga.Controls\Tree\TreeViewAdv.cs:line 561
   at Aga.Controls.Tree.TreeViewAdv.SmartFullUpdate() in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\Aga.Controls\Tree\TreeViewAdv.cs:line 836
   at Aga.Controls.Tree.TreeViewAdv._model_StructureChanged(Object sender, TreePathEventArgs e) in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\Aga.Controls\Tree\TreeViewAdv.cs:line 1045
   at MySQL.Grt.GrtListModel.OnStructureChanged(TreePathEventArgs args) in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\MySQLCsUtilities\GrtListModel.cs:line 165
   at MySQL.Grt.GrtListModel.RefreshModel() in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\MySQLCsUtilities\GrtListModel.cs:line 228
   at MySQL.GUI.Workbench.UndoHistoryForm.UpdateHistoryTree() in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\MySQLWorkbench\UndoHistoryForm.cs:line 42
   at MySQL.GUI.Workbench.UndoHistoryForm.invokeRefresh(NodeId node, Int32 oldCount) in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\MySQLWorkbench\UndoHistoryForm.cs:line 63
   at MySQL.Grt.RunWrappedDelegate2<void\,void\,bec::NodeId\,MySQL::Grt::NodeId ^\,int\,int\,MySQL::Grt::DelegateSlot2<void\,void\,bec::NodeId\,MySQL::Grt::NodeId ^\,int\,int>::ManagedDelegate>.native_callback(NodeId* a1, Int32* a2) in c:\users\tax\documents\visual studio 2008\projects\wb52\workbench\backend\windows\wbpublic.wr\src\sigcslot.h:line 143
   at sigc.pointer_functor2<bec::NodeId const &,int const &,void>.()(pointer_functor2<bec::NodeId const \&\,int const \&\,void>* , NodeId* _A_a1, Int32* _A_a2) in c:\users\tax\documents\visual studio 2008\projects\wb52\mysql-gui-win-res\include\sigc++\functors\ptr_fun.h:line 147
   at sigc.adaptor_functor<sigc::pointer_functor2<bec::NodeId const &,int const &,void> >.operator()<struct bec::NodeId const &,int const &>(adaptor_functor<sigc::pointer_functor2<bec::NodeId const \&\,int const \&\,void> >* , NodeId* _A_arg1, Int32* _A_arg2) in c:\users\tax\documents\visual studio 2008\projects\wb52\mysql-gui-win-res\include\sigc++\adaptors\adaptor_trait.h:line 101
   at sigc.internal.slot_call2<sigc::pointer_functor2<bec::NodeId const &,int const &,void>,void,bec::NodeId const &,int const &>.call_it(slot_rep* rep, NodeId* a_1, Int32* a_2) in c:\users\tax\documents\visual studio 2008\projects\wb52\mysql-gui-win-res\include\sigc++\functors\slot.h:line 173
   at sigc.slot2<void,bec::NodeId const &,int const &>.()(slot2<void\,bec::NodeId const \&\,int const \&>* , NodeId* _A_a1, Int32* _A_a2) in c:\users\tax\documents\visual studio 2008\projects\wb52\mysql-gui-win-res\include\sigc++\functors\slot.h:line 593
   at sigc.adaptor_functor<sigc::slot<void,bec::NodeId const &,int const &,sigc::nil,sigc::nil,sigc::nil,sigc::nil,sigc::nil> >.operator()<struct bec::NodeId const &,int const &>(adaptor_functor<sigc::slot<void\,bec::NodeId const \&\,int const \&\,sigc::nil\,sigc::nil\,sigc::nil\,sigc::nil\,sigc::nil> >* , NodeId* _A_arg1, Int32* _A_arg2) in c:\users\tax\documents\visual studio 2008\projects\wb52\mysql-gui-win-res\include\sigc++\adaptors\adaptor_trait.h:line 101
   at sigc.internal.slot_call2<sigc::slot<void,bec::NodeId const &,int const &,sigc::nil,sigc::nil,sigc::nil,sigc::nil,sigc::nil>,void,bec::NodeId,int>.call_it(slot_rep* rep, NodeId* a_1, Int32* a_2) in c:\users\tax\documents\visual studio 2008\projects\wb52\mysql-gui-win-res\include\sigc++\functors\slot.h:line 173
   at wb.WBContext.flush_idle_tasks(WBContext* )
   at MySQL.Workbench.WbContext.flush_idle_tasks() in c:\users\tax\documents\visual studio 2008\projects\wb52\workbench\backend\windows\wbprivate.wr\src\wb.h:line 909
   at MySQL.GUI.Workbench.Program.timer_Tick(Object sender, EventArgs e) in C:\Users\tax\Documents\Visual Studio 2008\Projects\wb52\workbench\frontend\windows\MySQLWorkbench\Program.cs:line 296

looks like a different problem, but it hits the same synopsis, so i'm setting it to verified again
[3 Aug 2010 9:55] Mike Lischke
Fixed also new error about Graphics in use elsewhere.
[16 Aug 2010 1:00] Roel Van de Paar
====
Exception = System.InvalidOperationException
Message = Object is currently in use elsewhere.
FullText = System.InvalidOperationException: Object is currently in use elsewhere.
   at System.Drawing.Graphics.MeasureString(String text, Font font, SizeF layoutArea, StringFormat stringFormat)
   at System.Drawing.Graphics.MeasureString(String text, Font font)
...
====
In 5.2.26.
[16 Aug 2010 2:41] Roel Van de Paar
Windows backtrace - note "Invalid window handle." -> the same issue as in bug #55776 and bug #55996

Attachment: windows trace.txt (text/plain), 31.91 KiB.

[16 Aug 2010 4:16] Roel Van de Paar
I am quite convinced that the following bugs:

bug #55304 | bug #55776 | bug #55904 | bug #55774 | bug #55828 | bug #55996

all have the same cause: some sort of issue with window/tab handles (note the "An invalid HANDLE was specified."). 

For more information, see the "[16 Aug 5:30] Roel Van de Paar" comment in bug #55996.

I have marked all the other bugs as a duplicate of this bug since this was the main one in which this issue was being handled.

There are many different error messages that could be shown for this bug.

Please read all other bug reports for more information, and you will also find additional video's in some of those bugs.
[16 Aug 2010 4:25] Roel Van de Paar
Also see comment "[16 Aug 5:03] Roel Van de Paar" in bug #55996
[18 Aug 2010 0:00] Roel Van de Paar
Bug #43155 is likely also a duplicate of this one (was a duplicate of bug #55904)
[18 Aug 2010 4:26] Roel Van de Paar
Sidenote: on a (completely unrelated) bug, I also noticed the same "An invalid HANDLE was specified.", but only for NTSTATUS (i.e. not the "(Win32) 0x578 (1400) - Invalid window handle.") so when checking for duplicates, look for the (Win32) error.
[23 Aug 2010 6:51] Roel Van de Paar
Destination array was not long enough. Check destIndex and length, and the array's lower bounds.

Attachment: workbench trace.txt (text/plain), 2.57 KiB.

[23 Aug 2010 6:52] Roel Van de Paar
Windows backtrace of the same crash (ref last comment)

Attachment: windows trace.txt (text/plain), 34.85 KiB.

[1 Sep 2010 13:43] Mike Lischke
Fixed in repository.
[2 Sep 2010 6:06] Roel Van de Paar
Wow, good job guys, I could not reproduce the crash (yet :)) in 5.2.27! Automatic tester completest fine where before it would always crash. Tested twice so far, including some random things.
[9 Sep 2010 19:48] joseph Dawang
crash on create eer

Attachment: BugIssuet.zip (application/x-zip-compressed, text), 59.92 KiB.

[16 Sep 2010 20:12] Johannes Taxacher
fix confirmed in repository
[17 Sep 2010 12:57] Tony Bedford
An entry has been added to the 5.2.28 changlog:

MySQL Workbench exhibited a variety of crashes if, in the Model View, EER diagrams were repeatedly created and deleted. MySQL Workbench also crashed if all objects in the diagram were copied and pasted to the same diagram several times, and then the diagram deleted. Unexpected errors generated included:

Object is currently in use elsewhere

Index is outside the bounds of the array

Index must be within the bounds of the List