Bug #43331 attempted to read or write protected memory / Unknown Exception caught
Submitted: 3 Mar 2009 14:18 Modified: 5 Jun 2009 9:13
Reporter: Bas Scheutjens Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S1 (Critical)
Version:5.0.30 OS:Windows (XP Pro)
Assigned to: Mike Lischke CPU Architecture:Any
Tags: CHECKED, workbench

[3 Mar 2009 14:18] Bas Scheutjens
Description:
Since a few days my installation of MySQL Workbench keeps crashing with two different types of error messages:

"attempted to read or write protected memory"

and

"Unknown Exception caught in %path%\backend\windows\wb.wr\src\Wb.h at line 1010"

These messages are shown in a normal messagebox windows. After clicking them away it looks like Workbench is still useable, but when I do anything (for example clicking on a table or the background canvas) I get the same messagebox again or a messagebox about an uncaught exception with a complete trace. I've included an example of this trace at the bottom.

I already tried to upgrade from version 5.0.29 to 5.0.30, but this didn't solve the problem.

==========
Trace:

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.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.30.3384
    Win32 Version: 5.0.30.3384
    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.3335.29009
    Win32 Version: 2.2.0.0
    CodeBase: file:///C:/Program%20Files/MySQL/MySQL%20Workbench%205.0%20OSS/WeifenLuo.WinFormsUI.Docking.DLL
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.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
----------------------------------------
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
----------------------------------------

************** 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 the file (either double clicking in explorer or start workbench first) and select multiple tables by dragging the mouse over some tables. This should generate the first error message.

Suggested fix:
None available
[3 Mar 2009 16:11] MySQL Verification Team
I couldn't repeat on Vista and XP with SE version.
[3 Mar 2009 16:17] Bas Scheutjens
Not? Too bad, because in my case it now crashes with each design I try to change, so Workbench isn't useable at all at the moment.

Could this be hardware related?
[3 Mar 2009 17:41] MySQL Verification Team
Have you edited some Tools->Options before began the crash?. I used the install default ones.
[4 Mar 2009 7:15] Bas Scheutjens
I haven't changed the options either.

Btw, thanks for your quick replies.
[4 Mar 2009 11:32] Rodrigo Olivares
Check this bug report (http://bugs.mysql.com/bug.php?id=41930)

The option "Automatically reopen last opened model when started" is checked by default maybe.

Bye
[4 Mar 2009 14:10] Bas Scheutjens
It has always been unchecked, but thanks for the suggestion.
[10 Mar 2009 11:35] Susanne Ebrecht
I can't repeat this behaviour too.

Please check your disk.

Click on my computer, right click on your hard disk, properties, clean up (general), error check (extras), defragmentation (extra)
[11 Mar 2009 13:26] Bas Scheutjens
I've checked the c drive, completely cleaned it up and defragged it, but it didn't help. I also checked and cleaned up my d drive, but I haven’t defragged it. This is for the following reasons:

1. Defrag said it wasn’t necessary
2. Workbench is installed on the c drive and all of the test files I use are located on the c drive, so the d drive isn’t used by Workbench when I try to reproduce the problem
3. I didn’t have time yet to run defrag because it takes too long to run it during the day (all my working files are on the d drive, so I can’t work during defrag)

As a last resort I’ve asked our system administrator to reinstall my computer and he will do this tomorrow. Hopefully it will be solved.
[11 Mar 2009 14:10] Bas Scheutjens
I have a small update. I used to get only error message when I was doing something (selecting tables, etc), but I just started to also get error messages when I was just looking at a design (we had to discuss something). It started 5 minutes ago and it happened already three times.

I got the following error:

************** Exception Text **************
System.Runtime.InteropServices.SEHException: External component has thrown an exception.
   at bec.GRTManager.flush_timers(GRTManager* )
   at MySQL.Workbench.WbContext.flush_timers()
   at MySQL.GUI.Workbench.MainForm.timer_Tick(Object sender, EventArgs e)
   at System.Windows.Forms.Timer.OnTick(EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
[13 Mar 2009 7:41] Bas Scheutjens
Another update.

My computer is reinstalled and on the second file I opened Workbench started to crash again.

Besides that, at my office we use Workbench with the four of us. I used to be the only one with problems, but one collogue is starting to get occasional problems and another one experiences the same as I do: Workbench is constantly crashing. 

The weird thing is that Workbench used to work correctly for all of us and after a while there are occasional problems and in the end Workbench is constantly crashing.

At this point we are considering to switch to another application because at the moment two of us aren't able to do our jobs.
[16 Mar 2009 13:50] Susanne Ebrecht
Unfortunately we are not able to reproduce it. We need your mwb file because we think it is related to your mwb file.

Please upload your mwb file.
[17 Mar 2009 7:31] Bas Scheutjens
I already uploaded one of the problem files, which was marked as private. But I’ll upload it again as public.
[17 Mar 2009 7:32] Bas Scheutjens
One of the files which generates the error

Attachment: DB Design.mwb (application/x-zip-compressed, text), 10.23 KiB.

[18 Mar 2009 11:13] Susanne Ebrecht
The problem seems to be related to installed visual studio.

Bug #43679 is a duplicate of this bug here. Please also read comments there.

I will set it to verified so that development will be able to look deeper into it.
[18 Mar 2009 11:25] Bas Scheutjens
Great to see you have been able to find a possible cause.

Is there any known workaround (except uninstalling Visual Studio when I need to use Workbench? ;) ).

Just for the record, I use Visual Studio 2008 Pro.
[18 Mar 2009 11:37] Cahya Subiyakto
I just posted a work around. It work fine for my PC.
Check bugs #43679.
[20 Mar 2009 9:03] Bas Scheutjens
Unfortunately the mentioned workaround (starting Workbench and open a file from there instead of opening it from explorer) doesn't work for me, but thanks anyway for the suggestion.
[31 Mar 2009 9:20] Simon Martin
I had the same symptoms on XP Pro with Workbench 5.0.3 and Visual Studio Express, the suggested workarounds did not work for me either.  Given I was only playing with Visual Studio but I really value Workbench I un-installed Visual Studio and ran a repair install on workbench, all errors appear to have stopped.
[28 May 2009 15:37] Jouno Aymeric
hi, i've exactly the same error message on win xp home fr
But, i'didn't got visual studio install...

i just repair install and it seems to fixed this bug.
to be continue...
[5 Jun 2009 9:13] Mike Lischke
Duplicate of Bug #43155