Bug #47044 Unhandled Exception When Expanding Schemata List
Submitted: 1 Sep 2009 15:08 Modified: 15 Oct 2009 9:02
Reporter: Matthew Watts Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S1 (Critical)
Version:5.2.2 Alpha OS:Microsoft Windows (Vista SP1)
Assigned to: CPU Architecture:Any
Tags: error, exception, schemata

[1 Sep 2009 15:08] Matthew Watts
Description:
Upon using the Query Editor and connecting successfully to the database with a default schemata - I wanted to expand the schemata and select a table. When I did, I received this exception:

------

************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at MySQL.Grt.TreeModel.expand_node(NodeId node)
   at MySQL.Grt.GrtTreeModel.TreeViewExpanding(Object sender, TreeViewAdvEventArgs e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Aga.Controls.Tree.TreeViewAdv.OnExpanding(TreeNodeAdv node)
   at Aga.Controls.Tree.TreeViewAdv.SetIsExpanded(TreeNodeAdv node, Boolean value)
   at Aga.Controls.Tree.TreeViewAdv.SetIsExpanded(ExpandArgs eargs)
   at Aga.Controls.Tree.TreeViewAdv.SetIsExpanded(TreeNodeAdv node, Boolean value, Boolean ignoreChildren)
   at Aga.Controls.Tree.TreeNodeAdv.SetIsExpanded(Boolean value, Boolean ignoreChildren)
   at Aga.Controls.Tree.TreeNodeAdv.set_IsExpanded(Boolean value)
   at Aga.Controls.Tree.NodeControls.NodePlusMinus.MouseDown(TreeNodeAdvMouseEventArgs args)
   at Aga.Controls.Tree.TreeViewAdv.OnMouseDown(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.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)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3074 (QFE.050727-3000)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
MySQLWorkbench
    Assembly Version: 5.2.2.3745
    Win32 Version: 5.2.2.3745
    CodeBase: file:///C:/Program%20Files%20(x86)/MySQL/MySQL%20Workbench%205.2%20OSS/MySQLWorkbench.exe
----------------------------------------
wbprivate.wr
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files%20(x86)/MySQL/MySQL%20Workbench%205.2%20OSS/wbprivate.wr.DLL
----------------------------------------
wbpublic.wr
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files%20(x86)/MySQL/MySQL%20Workbench%205.2%20OSS/wbpublic.wr.DLL
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
MySQLCsUtilities
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/MySQL/MySQL%20Workbench%205.2%20OSS/MySQLCsUtilities.DLL
----------------------------------------
msvcm90
    Assembly Version: 9.0.21022.8
    Win32 Version: 9.00.21022.8
    CodeBase: file:///C:/Windows/WinSxS/x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91/msvcm90.dll
----------------------------------------
MySQLGrtShell
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/MySQL/MySQL%20Workbench%205.2%20OSS/MySQLGrtShell.EXE
----------------------------------------
WeifenLuo.WinFormsUI.Docking
    Assembly Version: 2.2.3489.7562
    Win32 Version: 2.2.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/MySQL/MySQL%20Workbench%205.2%20OSS/WeifenLuo.WinFormsUI.Docking.DLL
----------------------------------------
WbPlugins
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/MySQL/MySQL%20Workbench%205.2%20OSS/WbPlugins.DLL
----------------------------------------
Aga.Controls
    Assembly Version: 1.6.0.0
    Win32 Version: 1.6.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/MySQL/MySQL%20Workbench%205.2%20OSS/Aga.Controls.DLL
----------------------------------------
grt.db.fe
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/MySQL/MySQL%20Workbench%205.2%20OSS/grt.db.fe.DLL
----------------------------------------
grt.helpers.be
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/MySQL/MySQL%20Workbench%205.2%20OSS/grt.helpers.be.DLL
----------------------------------------
sqlide.fe
    Assembly Version: 0.0.0.0
    Win32 Version: 0.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/MySQL/MySQL%20Workbench%205.2%20OSS/sqlide.fe.DLL
----------------------------------------
ScintillaNet
    Assembly Version: 2.0.3489.7727
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/MySQL/MySQL%20Workbench%205.2%20OSS/ScintillaNet.DLL
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3074 (QFE.050727-3000)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

How to repeat:
1) Open a Database Connection
2) Toggle the Sidebar to view Schemata
3) Left-click on the little + next to a Schemata to try and expand it

Suggested fix:
Aside from handling the exception, it would be nice to have the default Schemata already expanded.
[1 Sep 2009 15:23] Valeriy Kravchuk
On Mac OS X there is no crash, but also there is no way to expand schema and see tables in it.
[1 Sep 2009 15:38] Matthew Watts
It didn't crash the program. I got the message prompt letting me know there was an unhandled exception. The prompt gave me the option to view the details of the error, continue the application, or quit the application.

I just tried it on a few other databases on different servers and received the same error, so the memory that is not able to be accessed in the error message must be related to the local machine that Workbench is installed on.
[1 Sep 2009 21:24] MySQL Verification Team
Thank you for the bug report. Verified on Vista Home Premium 64-bit.
[13 Oct 2009 16:47] Johannes Taxacher
could not repeat that problem with 5.2.4.
[15 Oct 2009 9:02] Tony Bedford
An entry has been added to the 5.2.4 changelog:

In the Query Editor, when an attempt was made to expand a schema and select a table, the following exception was generated:

************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected memory. This is
often an indication that other memory is corrupt.
   at MySQL.Grt.TreeModel.expand_node(NodeId node)
   at MySQL.Grt.GrtTreeModel.TreeViewExpanding(Object sender, TreeViewAdvEventArgs e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Aga.Controls.Tree.TreeViewAdv.OnExpanding(TreeNodeAdv node)
   at Aga.Controls.Tree.TreeViewAdv.SetIsExpanded(TreeNodeAdv node, Boolean value)
   at Aga.Controls.Tree.TreeViewAdv.SetIsExpanded(ExpandArgs eargs)
   at Aga.Controls.Tree.TreeViewAdv.SetIsExpanded(TreeNodeAdv node, Boolean value, Boolean
ignoreChildren)
...