Bug #50554 WB crashes, possibly due to ssh tunnell timeout
Submitted: 22 Jan 2010 19:29 Modified: 17 Sep 2010 8:58
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.2.24 OS:Any (v.7)
Assigned to: CPU Architecture:Any

[22 Jan 2010 19:29] [ name withheld ]
Description:
************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at MySQL.Grt.ListModel.get_field(NodeId node, Int32 column, String& value)
   at MySQL.Utilities.GridView.OnCellValueNeeded(Object sender, DataGridViewCellValueEventArgs e)
   at System.Windows.Forms.DataGridView.OnCellValueNeeded(DataGridViewCellValueEventArgs e)
   at System.Windows.Forms.DataGridView.OnCellValueNeeded(Int32 columnIndex, Int32 rowIndex)
   at System.Windows.Forms.DataGridViewCell.GetValue(Int32 rowIndex)
   at System.Windows.Forms.DataGridViewCell.PaintWork(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex, DataGridViewElementStates cellState, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)
   at System.Windows.Forms.DataGridViewRow.PaintCells(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex, DataGridViewElementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow, DataGridViewPaintParts paintParts)
   at System.Windows.Forms.DataGridViewRow.Paint(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex, DataGridViewElementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow)
   at System.Windows.Forms.DataGridView.PaintRows(Graphics g, Rectangle boundingRect, Rectangle clipRect, Boolean singleHorizontalBorderAdded)
   at System.Windows.Forms.DataGridView.PaintGrid(Graphics g, Rectangle gridBounds, Rectangle clipRect, Boolean singleVerticalBorderAdded, Boolean singleHorizontalBorderAdded)
   at System.Windows.Forms.DataGridView.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.DataGridView.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.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
MySQLWorkbench
    Assembly Version: 5.2.14.4990
    Win32 Version: 5.2.14.4990
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.2%20OSS/MySQLWorkbench.exe
----------------------------------------
wbprivate.wr
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.2%20OSS/wbprivate.wr.DLL
----------------------------------------
wbpublic.wr
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.2%20OSS/wbpublic.wr.DLL
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    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.4927 (NetFXspW7.050727-4900)
    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.4927 (NetFXspW7.050727-4900)
    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/MySQL/MySQL%20Workbench%205.2%20OSS/MySQLCsUtilities.DLL
----------------------------------------
msvcm90
    Assembly Version: 9.0.30729.4926
    Win32 Version: 9.00.30729.4926
    CodeBase: file:///C:/Windows/WinSxS/x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4926_none_508ed732bcbc0e5a/msvcm90.dll
----------------------------------------
WeifenLuo.WinFormsUI.Docking
    Assembly Version: 2.2.3672.32280
    Win32 Version: 2.2.0.0
    CodeBase: file:///C:/Program%20Files/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/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/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/MySQL/MySQL%20Workbench%205.2%20OSS/grt.db.fe.DLL
----------------------------------------
sqlide.fe
    Assembly Version: 0.0.0.0
    Win32 Version: 0.0.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.2%20OSS/sqlide.fe.DLL
----------------------------------------
ScintillaNet
    Assembly Version: 2.0.3672.32303
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.2%20OSS/ScintillaNet.DLL
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
grt.helpers.be
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.2%20OSS/grt.helpers.be.DLL
----------------------------------------

How to repeat:
Not sure how to reproduce. May be new manifestation of Bug #50205. I had WB open, ran some queries, put computer to sleep, moved to a new network, woke up the computer, and tried to run a new query.
[26 Jan 2010 9:03] Susanne Ebrecht
How did you connect remote to Workbench?
[26 Jan 2010 18:11] [ name withheld ]
WB connecting to remote via ssh tunnel. Is that what you mean? Because that's the title of the bug. :)
[28 Jan 2010 2:24] Miguel Solorzano
Are you using the binary shipped without installer?. I got crashes with that binary and resolved installing the msi package.
[28 Jan 2010 16:12] [ name withheld ]
No, I'm using the .msi.
[28 Jan 2010 23:15] Miguel Solorzano
Please try the latest release 5.2.15a. Thanks in advance.
[29 Jan 2010 16:33] [ name withheld ]
I will try 5.2.15, but I don't have a reliable way to reproduce this bug even in 5.2.14.
[11 Feb 2010 21:47] [ name withheld ]
Just hit this bug again in WB 5.2.15. Updating version field.

Exception = System.AccessViolationException
Message = Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
FullText = System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at MySQL.Grt.ListModel.get_field(NodeId node, Int32 column, String& value)
   at MySQL.Utilities.GridView.OnCellValueNeeded(Object sender, DataGridViewCellValueEventArgs e)
   at System.Windows.Forms.DataGridView.OnCellValueNeeded(DataGridViewCellValueEventArgs e)
   at System.Windows.Forms.DataGridView.OnCellValueNeeded(Int32 columnIndex, Int32 rowIndex)
   at System.Windows.Forms.DataGridViewCell.GetValue(Int32 rowIndex)
   at System.Windows.Forms.DataGridViewCell.PaintWork(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex, DataGridViewElementStates cellState, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)
   at System.Windows.Forms.DataGridViewRow.PaintCells(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex, DataGridViewElementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow, DataGridViewPaintParts paintParts)
   at System.Windows.Forms.DataGridViewRow.Paint(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex, DataGridViewElementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow)
   at System.Windows.Forms.DataGridView.PaintRows(Graphics g, Rectangle boundingRect, Rectangle clipRect, Boolean singleHorizontalBorderAdded)
   at System.Windows.Forms.DataGridView.PaintGrid(Graphics g, Rectangle gridBounds, Rectangle clipRect, Boolean singleVerticalBorderAdded, Boolean singleHorizontalBorderAdded)
   at System.Windows.Forms.DataGridView.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.DataGridView.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)
[24 Feb 2010 19:45] [ name withheld ]
Still in WB 5.2.16.

Exception = System.AccessViolationException
Message = Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
FullText = System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at MySQL.Grt.GridModel.get_field_repr(NodeId node, Int32 column, String& value)
   at MySQL.Utilities.GridView.OnCellValueNeeded(Object sender, DataGridViewCellValueEventArgs e)
   at System.Windows.Forms.DataGridView.OnCellValueNeeded(DataGridViewCellValueEventArgs e)
   at System.Windows.Forms.DataGridView.OnCellValueNeeded(Int32 columnIndex, Int32 rowIndex)
   at System.Windows.Forms.DataGridViewCell.GetValue(Int32 rowIndex)
   at System.Windows.Forms.DataGridViewCell.PaintWork(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex, DataGridViewElementStates cellState, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)
   at System.Windows.Forms.DataGridViewRow.PaintCells(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex, DataGridViewElementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow, DataGridViewPaintParts paintParts)
   at System.Windows.Forms.DataGridViewRow.Paint(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex, DataGridViewElementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow)
   at System.Windows.Forms.DataGridView.PaintRows(Graphics g, Rectangle boundingRect, Rectangle clipRect, Boolean singleHorizontalBorderAdded)
   at System.Windows.Forms.DataGridView.PaintGrid(Graphics g, Rectangle gridBounds, Rectangle clipRect, Boolean singleVerticalBorderAdded, Boolean singleHorizontalBorderAdded)
   at System.Windows.Forms.DataGridView.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.DataGridView.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)
[8 Apr 2010 21:25] [ name withheld ]
Some variation of this is still in 5.2.17. WB doesn't want to reuse a tunnel that was set up just a few hours ago and maybe on a different LAN.
[25 Apr 2010 14:26] Sveta Smirnova
Thank you for the feedback.

I can not repeat described behavior: WB connects via SSH tunnel fine. I use SSH from Cygwin installation.

Please try with current version 5.2.19 and if problem still exists provide step-by-step instructions how you setup SSH tunnel, connect WB to MySQL via tunnel and which steps you do next.
[26 Apr 2010 16:12] [ name withheld ]
This still occurs in Wb 5.2.19

Reproducing on 32bit Windows 7...

1) run Pageant 0.60 (from PuTTY), add key to Pageant. 

2) open WB, open SSH-tunnelled connection

3) execute some queries

4) put computer to sleep, move to a different LAN, wait 12-24 hours.

5) wake up computer

6) try to execute a new query (or just refresh a previous one, or tell WB to reconnect to the database)

7) WB crashes.
[26 Apr 2010 19:43] Sveta Smirnova
Thank you for the feedback.

Does it really crash or just displays "Report a Bug" dialog and continues working?
[26 Apr 2010 20:10] [ name withheld ]
When it crashes, it stops accepting input, and eventually I get the Windows dialog that says "this application has stopped working".
[5 Jun 2010 2:26] Miguel Solorzano
Could you please try version 5.2.22.Thanks in advance.
[12 Jun 2010 15:08] [ name withheld ]
Still occurs in 5.2.22.

Have you checked the error handling around SSH? It feels like the kind of bug that would be caught with good unit testing.
[24 Jun 2010 8:12] Susanne Ebrecht
Many thanks for your feedback.

Very odd stuff is happening when SSH connection got lost.

During my tests, after killing ssh connection either Workbench crashed or it hanged or it totally got confused.

How to test:

Take two machines and place them into your network.
One machine for the server the other for Workbench
start server
open Workbench
Configure an instance for your remote server

Play a little bit with remote server via Workbench
Just let Workbench Administrator tabs open

Cut network wire from server machine

Wait 5-10 Minutes

Put network wire again into your server machine and
start networking

Now try to work further on with Workbench

I tried it 7 times and it behaves different all 7 times
[8 Jul 2010 3:42] [ name withheld ]
I've not encountered this bug in the week that I've been using 5.2.25. (But now that I've written this message, it's bound to happen in the next 10 minutes.) I see nothing in the changelog that should suggest that it's been fixed.
[11 Aug 2010 15:03] [ name withheld ]
I've not encountered this bug with either 5.2.25 or .26. I don't know if you've found the root cause, but it's not a problem any more.
[10 Sep 2010 6:08] Alfredo Kojima
As the original reporter says the bug is gone, I suppose this can be closed.
[16 Sep 2010 23:45] Johannes Taxacher
can be closed as fixed in 5.2.25
[17 Sep 2010 0:19] [ name withheld ]
It still hasn't recurred for me. But let me emphasize that you still don't know the root cause. It looks like something around this bug may have been fixed, but not the bug itself.
[17 Sep 2010 8:58] Tony Bedford
An entry has been added to the 5.2.25 changelog:

MySQL Workbench displayed instability after an SSH connection to the server was closed. This resulted in hanging or crashing behavior.