Bug #59742 Crashed while typing in SQL Editor
Submitted: 26 Jan 2011 14:43 Modified: 11 Mar 2011 22:00
Reporter: Peter Kniaz Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:5.2.31 7115 OS:Windows (Vista)
Assigned to: CPU Architecture:Any

[26 Jan 2011 14:43] Peter Kniaz
Description:
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 Sql_editor.check_sql(Sql_editor* , Boolean )
   at MySQL.Grt.Db.Sql.Sql_editor.check_sql(Boolean sync)
   at MySQL.Grt.Db.Sql.SqlEditor.CheckSql(Boolean sync)
   at MySQL.Grt.Db.Sql.SqlEditor.RunBackgroundAction(Boolean sync)
   at MySQL.Grt.Db.Sql.SqlEditor.BackgroundActionTimer(Object obj, EventArgs args)
   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)

How to repeat:
Not sure
[26 Jan 2011 18:01] Valeriy Kravchuk
Please, send the output of Help > System Info menu item.
[26 Jan 2011 20:19] Peter Kniaz
See below.  Also, by the way, after getting the crash screen and reporting the error, when I hit OK I was able to stay in the app.  Below is the Help-system-info:
MySQL Workbench CE for Windows version 5.2.31

Configuration Directory: C:\Users\PKNIAZ\AppData\Roaming\MySQL\Workbench

Data Directory: C:\Program Files\MySQL\MySQL Workbench 5.2 CE

Cairo Version: 1.8.8

Rendering Mode: OpenGL is available on this system, but GDI was requested. Using GDI for rendering.

OS: Microsoft Windows Vista Business Edition Service Pack 2 (build 6002), 32-bit

CPU: 2x Intel(R) Core(TM)2 Duo CPU     T7300  @ 2.00GHz, 3.5 GiB RAM

Active video adapter: Mobile Intel(R) 965 Express Chipset Family

Installed video RAM: 448 MB

Current video mode: 1280 x 800 x 4294967296 colors

Used bit depth: 32

Driver version: NULL

Installed display drivers: igdumd32.dll

Current user language: English (United States)
[27 Jan 2011 16:32] Sveta Smirnova
Looks very similar to bug #51815
[31 Jan 2011 15:21] MySQL Verification Team
Could you please elaborate step by step how it happens on your environment. I couldn't repeat on Vista 64-bit. Thanks in advance.
[1 Feb 2011 13:54] Peter Kniaz
I don't know why it suddenly gave me the crash screen.  I hadn't done anything unusual that I know of.  I was hoping the dump info would give you a clue.  I'll try to give more info next time it happens.
[1 Feb 2011 20:41] Peter Kniaz
It happened again. I had just backspaced (i.e., deleted) a character and then typed in the correct character in the middle of line 143 of a 155 line sql script. 
The error pop up appeared: "Mysql Workbench unexpected error".  After right clicking and getting the dump, I was able to close the pop-up, save the script and open another script window (without having to close and reopen WB).  The Script window where the problem occurred, however, would not respond to anything, and when I returned to that window it was blank.  Here is the info from right-clicking "Mysql Workbench unexpected error" pop-up:

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 Sql_editor.check_sql(Sql_editor* , Boolean )
   at MySQL.Grt.Db.Sql.Sql_editor.check_sql(Boolean sync)
   at MySQL.Grt.Db.Sql.SqlEditor.CheckSql(Boolean sync)
   at MySQL.Grt.Db.Sql.SqlEditor.RunBackgroundAction(Boolean sync)
   at MySQL.Grt.Db.Sql.SqlEditor.BackgroundActionTimer(Object obj, EventArgs args)
   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)
[8 Feb 2011 15:11] Alfredo Kojima
From the stack trace and description this is the same as bug #56034, however no one was able to find a reliable way to repeat this yet.
[18 Feb 2011 12:47] Peter Kniaz
Happened again.  I was just adding something to my query.  Here's the dump:
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 Sql_editor.check_sql(Sql_editor* , Boolean )
   at MySQL.Grt.Db.Sql.Sql_editor.check_sql(Boolean sync)
   at MySQL.Grt.Db.Sql.SqlEditor.CheckSql(Boolean sync)
   at MySQL.Grt.Db.Sql.SqlEditor.RunBackgroundAction(Boolean sync)
   at MySQL.Grt.Db.Sql.SqlEditor.BackgroundActionTimer(Object obj, EventArgs args)
   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)
[11 Mar 2011 18:57] Peter Kniaz
Happened again.  This time I was typing in a comment line (a line starting with a #, which was highlighted blue), so I doubt Workbench was doing any syntax checking.  Here is the dump:

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 Sql_editor.check_sql(Sql_editor* , Boolean )
   at MySQL.Grt.Db.Sql.Sql_editor.check_sql(Boolean sync)
   at MySQL.Grt.Db.Sql.SqlEditor.CheckSql(Boolean sync)
   at MySQL.Grt.Db.Sql.SqlEditor.RunBackgroundAction(Boolean sync)
   at MySQL.Grt.Db.Sql.SqlEditor.BackgroundActionTimer(Object obj, EventArgs args)
   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)
[11 Mar 2011 22:01] Peter Kniaz
Happened again. (Twice in the same day.) Possible clue:  Both times today I had a case statement in my select.  I've noticed that as soon as you enter a case statement it puts a line down the left hand border as if the rest of the script is part of the case statement.  Sometimes it keeps this line all the way to the end of the script even when you enter "end" to end the case statement -- i.e., sometimes it doesn't seem to recognize the "end" as ending the case statement.  This can be gotten around by enclosing the whole case statement in parentheses.  Maybe it's getting confused trying to parse what it thinks is an enormous case statement....
[3 Dec 2011 20:39] Gordon MacKay
I have at least one crash a day where the SQL parser looses it. Good fix would be the ability to turn the parser off and avoid the Sql_editor::check_sql crashes. I know what I'm doing and don't need the parser.