Bug #41146 Attempt to read protected memory -- double-clicking a table
Submitted: 1 Dec 2008 8:32 Modified: 26 May 2009 12:27
Reporter: Christopher Albans Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:mysql-workbench-oss-5.0.27-win32.msi OS:Windows (XP SP3 32-bit)
Assigned to: CPU Architecture:Any
Tags: error, Memory

[1 Dec 2008 8:32] Christopher Albans
Description:
I've been getting this error pretty often over the past two days.

Here's how I recreate it... Double-click my whatever.mwb file, then everything loads.

Then I double-click one of my tables and the following error occurs:
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

In my latest recreation of the bug two of these notices popped up, one on top of the other. Then if I click "OK" through both errors the following pops up:
"Unhandled exception has occurred in your application. ... Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Then I click "Details" for the following Exception Test report:

=============================================================================

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at wb.WBContextUI.set_active_form(WBContextUI* , UIForm* )
   at MySQL.Workbench.WbContext.set_active_form(UIForm uiform)
   at MySQL.GUI.Workbench.MainForm.mainDockPanel_ActiveDocumentChanged(Object sender, EventArgs e)
   at WeifenLuo.WinFormsUI.Docking.DockPanel.OnActiveDocumentChanged(EventArgs e)
   at WeifenLuo.WinFormsUI.Docking.DockPanel.FocusManagerImpl.RefreshActiveWindow()
   at WeifenLuo.WinFormsUI.Docking.DockPanel.FocusManagerImpl.HookEventHandler(Object sender, HookEventArgs e)
   at WeifenLuo.WinFormsUI.Docking.DockPanel.FocusManagerImpl.LocalWindowsHook.OnHookInvoked(HookEventArgs e)
   at WeifenLuo.WinFormsUI.Docking.DockPanel.FocusManagerImpl.LocalWindowsHook.CoreHookProc(Int32 code, IntPtr wParam, IntPtr lParam)
   at WeifenLuo.WinFormsUI.Docking.NativeMethods.CallNextHookEx(IntPtr hhook, Int32 code, IntPtr wParam, IntPtr lParam)
   at WeifenLuo.WinFormsUI.Docking.DockPanel.FocusManagerImpl.LocalWindowsHook.CoreHookProc(Int32 code, IntPtr wParam, IntPtr lParam)
   at WeifenLuo.WinFormsUI.Docking.NativeMethods.CallNextHookEx(IntPtr hhook, Int32 code, IntPtr wParam, IntPtr lParam)
   at WeifenLuo.WinFormsUI.Docking.DockPanel.FocusManagerImpl.LocalWindowsHook.CoreHookProc(Int32 code, IntPtr wParam, IntPtr lParam)
   at WeifenLuo.WinFormsUI.Docking.NativeMethods.CallNextHookEx(IntPtr hhook, Int32 code, IntPtr wParam, IntPtr lParam)
   at WeifenLuo.WinFormsUI.Docking.DockPanel.FocusManagerImpl.LocalWindowsHook.CoreHookProc(Int32 code, IntPtr wParam, IntPtr lParam)
   at WeifenLuo.WinFormsUI.Docking.NativeMethods.SetFocus(IntPtr hWnd)
   at WeifenLuo.WinFormsUI.Docking.DockPanel.FocusManagerImpl.Activate(IDockContent content)
   at WeifenLuo.WinFormsUI.Docking.DockContentHandler.Activate()
   at WeifenLuo.WinFormsUI.Docking.DockPane.Activate()
   at WeifenLuo.WinFormsUI.Docking.DockPane.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.1433 (REDBITS.050727-1400)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
MySQLWorkbench
    Assembly Version: 5.0.27.3318
    Win32 Version: 5.0.27.3318
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/MySQLWorkbench.exe
----------------------------------------
wb.wr
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/wb.wr.DLL
----------------------------------------
grt.wr
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/grt.wr.DLL
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
    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.1433 (REDBITS.050727-1400)
    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.1433 (REDBITS.050727-1400)
    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.0%20OSS/MySQLCsUtilities.DLL
----------------------------------------
msvcm80
    Assembly Version: 8.0.50727.1433
    Win32 Version: 8.00.50727.1433
    CodeBase: file:///C:/WINDOWS/WinSxS/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.1433_x-ww_5cf844d2/msvcm80.dll
----------------------------------------
MySQLGrtShell
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/MySQLGrtShell.EXE
----------------------------------------
WeifenLuo.WinFormsUI.Docking
    Assembly Version: 2.2.3232.43134
    Win32 Version: 2.2.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/WeifenLuo.WinFormsUI.Docking.DLL
----------------------------------------
MySQLWorkbenchEditors
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/MySQLWorkbenchEditors.DLL
----------------------------------------
Aga.Controls
    Assembly Version: 1.6.0.0
    Win32 Version: 1.6.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/Aga.Controls.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.0%20OSS/grt.helpers.be.DLL
----------------------------------------
db.mysql.editors.wbp.fe
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/db.mysql.editors.wbp.fe.DLL
----------------------------------------
db.mysql.editors.wbp.wr
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/db.mysql.editors.wbp.wr.DLL
----------------------------------------
grt.db.wr
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/grt.db.wr.DLL
----------------------------------------
ScintillaNet
    Assembly Version: 2.0.3232.42824
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/ScintillaNet.DLL
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

How to repeat:
Open my file, double-click a table (sometimes I have to double-click on a few, doesn't always occur on the first table double-click).

That's it.
[1 Dec 2008 8:38] Christopher Albans
Alternatively I get this error, but this error does not force me to quit the program:

"Unknown Exception caught in c:\documents and settings\mysqldev\my documents\visual studio 2005\workbench\backend\windows\wb.wr\src.Wh.h at line 1010"
[1 Dec 2008 13:37] MySQL Verification Team
Thank you for the bug report. I couldn't repeat the behavior reported, is there an specif table which occurs the crash when double clicked?. Thanks in advance.
[1 Dec 2008 18:08] Christopher Albans
I usually double-clicked on the TRANSACTIONS or MEMBERS table... Also it happened another time, when my friend sent his .MWB file to me, and I opened it and was clicking around to different tables then it crashed.

At one point like 50 of those little error message dialog boxes kept popping up over and over again and I had to force quit to make them stop. :P Heheh.

Sometimes I might load up the file and start double-clicking and no problems occur... But then another time I load the file up and start double-clicking and it happens. :( Not very consistent.

Past 3 hours of use have been OK though, I've been quite productive in modifying the DB with no errors (yet) -- although I have noticed a bit of sluggishness when dragging a table around on the canvas that a Workbench restart seems to fix.
[2 Dec 2008 7:46] Valeriy Kravchuk
I also can not repeat the problem with your file uploaded. Can you try to check if you have a lot of memory used at the moments when problem happens?

Also, please, copy and paste here the output of Help | System Info.
[2 Dec 2008 11:56] Christopher Albans
It happened again with this most recently attached file. After the program crashed I:

+ opened the .mwb file again
+ scrolled up and down with my mousewheel, checkin' out all the tables
+ double-clicked on a table
+ selected some random column from the table to edit a value (didn't change anything though)
+ double-clicked on another table
---> got the error again

Also I'm listening to Progressive House with Winamp. :P

==========================================================================

Looking for user plugins in C:\Documents and Settings\Chris\Application Data\MySQL\Workbench\modules
Looking for user plugins in C:\Documents and Settings\Chris\Application Data\MySQL\Workbench\plugins
MySQL Workbench OSS for Windows version 5.0.27
Cairo Version: 1.5.12
Rendering Mode: GDI Rendering
OpenGL Driver Version: Not Detected
OS: Windows XP
CPU: AMD Athlon(tm) 64 Processor 3200+, 1.0 GB RAM
Video adapter info:
Adapter type: NVIDIA GeForce 9600 GSO
Chip Type: GeForce 9600 GSO
BIOS String: Version 62.92.43.00.01
Video Memory: 393216 KB
[2 Dec 2008 21:27] Michael Skulsky
I also have this error intermittently, but the exception is slightly different (see below). There is not a lot of memory used, there's about 300 Mbytes of physical memory yet available. System info returns the following:

Looking for user plugins in C:\Documents and Settings\skulsky\Application Data\MySQL\Workbench\modules
Looking for user plugins in C:\Documents and Settings\skulsky\Application Data\MySQL\Workbench\plugins
MySQL Workbench OSS for Windows version 5.0.27
Cairo Version: 1.5.12
Rendering Mode: GDI Rendering
OpenGL Driver Version: Not Detected
OS: Windows XP
CPU: 2x Intel(R) Core(TM)2 CPU         T5500  @ 1.66GHz, 1.0 GB RAM
Video adapter info:
Adapter type: Mobile Intel(R) 945GM Express Chipset Family
Chip Type: Intel(R) GMA 950
BIOS String: Intel Video BIOS
Video Memory: 229376 KB
MySQL Workbench OSS for Windows version 5.0.27
Cairo Version: 1.5.12
Rendering Mode: GDI Rendering
OpenGL Driver Version: Not Detected
OS: Windows XP
CPU: 2x Intel(R) Core(TM)2 CPU         T5500  @ 1.66GHz, 1.0 GB RAM
Video adapter info:
Adapter type: Mobile Intel(R) 945GM Express Chipset Family
Chip Type: Intel(R) GMA 950
BIOS String: Intel Video BIOS
Video Memory: 229376 KB

Note that this error is not 100% reproducible, I'm getting it sometimes during double-click on a talbe, but then with the same actions it is no more there. But it is a real thing and happens quite often. 

************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at wb.ModelViewForm.handle_mouse_move(ModelViewForm* , Int32 , Int32 , EventState )
   at MySQL.Workbench.ModelViewForm.OnMouseMove(MouseEventArgs e, Int32 X, Int32 Y, Keys keystate, MouseButtons buttons)
   at MySQL.GUI.Workbench.ModelViewForm.CanvasPanel_MouseMove(Object sender, MouseEventArgs e)
   at System.Windows.Forms.Control.OnMouseMove(MouseEventArgs e)
   at MySQL.Utilities.WindowsCanvasViewerPanel.OnMouseMove(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseMove(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.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.1433 (REDBITS.050727-1400)
    CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
MySQLWorkbench
    Assembly Version: 5.0.27.3318
    Win32 Version: 5.0.27.3318
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/MySQLWorkbench.exe
----------------------------------------
wb.wr
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/wb.wr.DLL
----------------------------------------
grt.wr
    Assembly Version: 0.0.0.0
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/grt.wr.DLL
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
    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.1433 (REDBITS.050727-1400)
    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.1433 (REDBITS.050727-1400)
    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.0%20OSS/MySQLCsUtilities.DLL
----------------------------------------
msvcm80
    Assembly Version: 8.0.50727.1433
    Win32 Version: 8.00.50727.1433
    CodeBase: file:///C:/WINDOWS/WinSxS/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.1433_x-ww_5cf844d2/msvcm80.dll
----------------------------------------
MySQLGrtShell
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/MySQLGrtShell.EXE
----------------------------------------
WeifenLuo.WinFormsUI.Docking
    Assembly Version: 2.2.3232.43134
    Win32 Version: 2.2.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/WeifenLuo.WinFormsUI.Docking.DLL
----------------------------------------
MySQLWorkbenchEditors
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/MySQLWorkbenchEditors.DLL
----------------------------------------
Aga.Controls
    Assembly Version: 1.6.0.0
    Win32 Version: 1.6.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/Aga.Controls.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.0%20OSS/grt.helpers.be.DLL
----------------------------------------
[2 Dec 2008 21:46] Michael Skulsky
I've just made an interesting observation: it seems that I'm only able to reproduce the problem when I open the mwb file by double-clicking it in Windows Explorer - but not when I open it from within the Workbench. The error happens for me right when I add a table right after opening the mwb file, it is quite reproducible when I open the file as described. Yet it obviously depends on file contents, because I am not able to reproduce the problem on an empty base. In the attachment you can find the mwb, for which the problem reproduces.
[3 Dec 2008 13:44] Susanne Ebrecht
Many thanks for writing a bug report.

I can reproduce this behaviour.

Here is my test:

1) Download mwb file that was hidden pasted on 1st Dec.

2) click on the file

Workbench will open it

3) double click on a table ...

You will get an error message
[26 May 2009 12:27] Susanne Ebrecht
Thank you for your bug report. This issue has already been fixed in Workbench 5.2, which you can download at

  http://www.mysql.com/downloads/
[26 May 2009 12:28] Susanne Ebrecht
It is already fixed in version 5.0.30