Bug #51685 Crash closing while fetching
Submitted: 3 Mar 2010 10:33 Modified: 26 Mar 2010 13:22
Reporter: Ilan Tayari Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:5.2.16 rev 5249 OS:Windows
Assigned to: Sergei Tkachenko CPU Architecture:Any

[3 Mar 2010 10:33] Ilan Tayari
Description:
WorkBench crashes if you close it while it is still "fetching" table names etc.

How to repeat:
1. Open WorkBench
2. Connect to a server in the "SQL Development" section
3. Quickly (while it is still "fetching...") press Ctrl-W to close the connection
[3 Mar 2010 10:35] Ilan Tayari
Forgot to mention: I run WorkBnech on Windows 7 Enterprise
Also, my MySQL server is in another continent, and I connect to it over a VPN, so it takes some 5-10 seconds to finish "fetching..." on my configuration.
[4 Mar 2010 7:39] Susanne Ebrecht
Many thanks for writing a bug report. I am not able to repeat this.
[4 Mar 2010 8:06] Ilan Tayari
Susanne, thanks for checking it out.
On my system it is 100% reproducible, with any of the ~15 different connections  I have configured (several very different servers).

Is there any form of information I can gather that would help pinpoint the cause of the crash?
[4 Mar 2010 8:13] Ilan Tayari
I am using Windows 7 with visual Studio 2008 installed, so i clicked "Debug" on the crash message, and ended up with: 

Unhandled exception at 0x04bbb22a in MySQLWorkbench.exe: 0xC0000005: Access violation reading location 0x0000000d.

Breaking into the disassembler, I get see that this address is in wbpublic.be.dll

Stack trace is: 
>	wbpublic.be.dll!04bbb22a() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for wbpublic.be.dll]	
 	wbpublic.be.dll!04bbbb4e() 	
 	wbpublic.be.dll!04d239db() 	
 	wbpublic.be.dll!04c608b2() 	
 	wbprivate.be.dll!04748898() 	
 	KernelBase.dll!75737d9c() 	
 	KernelBase.dll!75737d0e() 	
 	wbpublic.be.dll!04c60f60() 	
 	wbpublic.be.dll!04c60c75() 	
 	sigc-2.0.dll!014a3d1d() 	
 	sigc-2.0.dll!014a40d0() 	
 	wbpublic.be.dll!04bbc4f7() 	
 	wbpublic.be.dll!04b3a140() 	
 	wbpublic.be.dll!04bbb64b() 	
 	wbpublic.be.dll!04bbb02b() 	
 	msvcrt.dll!76ecade8() 	
 	msvcrt.dll!76ecc470() 	
 	libglib-2.0-0.dll!672f7af5() 	
 	libgthread-2.0-0.dll!013d20da() 	
 	msvcrt.dll!76eca53a() 	
 	msvcrt.dll!76ed1287() 	
 	msvcrt.dll!76ed1328() 	
 	kernel32.dll!77221194() 	
 	ntdll.dll!7752b3f5() 	
 	ntdll.dll!7752b3c8() 	
 	shell32.dll!7661d34a() 	

and the crash is at:
04BBB22A  movzx       ecx,byte ptr [eax+0Dh] 
when EAX is 0

Are there debug symbols I could download to get more information, or map files or some such?
[5 Mar 2010 9:55] Susanne Ebrecht
Please upload the full trace.
[5 Mar 2010 13:22] Ilan Tayari
This is the full WER log I got, but I'm quite sure there should be more technical data that I could find. I just don't know how (I'm new to Windows 7 error debugging, there's no Dr Watson here)
Can you point me to information on how to gather the trace you want?

<?xml version="1.0" encoding="UTF-16"?>
<WERReportMetadata>
	<OSVersionInformation>
		<WindowsNTVersion>6.1</WindowsNTVersion>
		<Build>7600 </Build>
		<Product>(0x4): Windows 7 Enterprise</Product>
		<Edition>Enterprise</Edition>
		<BuildString>7600.16481.x86fre.win7_gdr.091207-1941</BuildString>
		<Revision>1</Revision>
		<Flavor>Multiprocessor Free</Flavor>
		<Architecture>X86</Architecture>
		<LCID>1033</LCID>
	</OSVersionInformation>
	<ParentProcessInformation>
		<ParentProcessId>6956</ParentProcessId>
		<ParentProcessPath>C:\Windows\explorer.exe</ParentProcessPath>
		<ParentProcessCmdLine>&quot;C:\Windows\explorer.exe&quot; </ParentProcessCmdLine>
	</ParentProcessInformation>
	<ProblemSignatures>
		<EventType>APPCRASH</EventType>
		<Parameter0>MySQLWorkbench.exe</Parameter0>
		<Parameter1>5.2.16.5249</Parameter1>
		<Parameter2>4b7b0da4</Parameter2>
		<Parameter3>wbpublic.be.dll</Parameter3>
		<Parameter4>0.0.0.0</Parameter4>
		<Parameter5>4b7b0754</Parameter5>
		<Parameter6>c0000005</Parameter6>
		<Parameter7>0009b22a</Parameter7>
	</ProblemSignatures>
	<DynamicSignatures>
		<Parameter1>6.1.7600.2.0.0.256.4</Parameter1>
		<Parameter2>1033</Parameter2>
	</DynamicSignatures>
	<SystemInformation>
		<MID>D9E9F000-306E-47A1-9948-41FCAC13150A</MID>
		<SystemManufacturer>LENOVO</SystemManufacturer>
		<SystemProductName>2958</SystemProductName>
		<BIOSVersion>18CN37WW(V2.10)</BIOSVersion>
	</SystemInformation>
</WERReportMetadata>
[6 Mar 2010 10:28] Ilan Tayari
Hi again,
I took the time to download and build the WorkBench 5.2.16 sources, and I can report that an error occurs under the same circumstances in a debug build as well.

The error is:
A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll

Additional information: Cross-thread operation not valid: Control 'schemataComboBox' accessed from a thread other than the thread it was created on.

And the stack trace upon breaking is:
 	System.Windows.Forms.dll!System.Windows.Forms.Control.Handle.get() + 0xc4 bytes	
 	System.Windows.Forms.dll!System.Windows.Forms.Control.SendMessage(int msg = 331, int wparam = 0, int lparam = 0) + 0x14 bytes	
 	System.Windows.Forms.dll!System.Windows.Forms.ComboBox.NativeClear() + 0x31 bytes	
 	System.Windows.Forms.dll!System.Windows.Forms.ComboBox.ObjectCollection.ClearInternal() + 0x57 bytes	
 	System.Windows.Forms.dll!System.Windows.Forms.ComboBox.ObjectCollection.Clear() + 0x17 bytes	
>	MySQLWorkbench.exe!MySQL.GUI.Workbench.SqlIdeSideBar.RefreshEx(MySQL.GUI.Workbench.DbSqlEditor dbSqlEditor = {MySQL.GUI.Workbench.DbSqlEditor, Text: }, bool force = true) Line 56 + 0x1d bytes	C#
 	MySQLWorkbench.exe!MySQL.GUI.Workbench.SqlIdeSideBar.Refresh(MySQL.GUI.Workbench.DbSqlEditor dbSqlEditor = {MySQL.GUI.Workbench.DbSqlEditor, Text: }) Line 40 + 0xd bytes	C#
 	MySQLWorkbench.exe!MySQL.GUI.Workbench.DbSqlEditor.OnPartialRefresh(int what = 1) Line 215 + 0x13 bytes	C#
 	wbpublic.wr.dll!MySQL::Grt::DelegateSlot1<void,void,int,int>::cpp_callback(int& a1 = 1) Line 175	C++
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	wbpublic.wr.dll!sigc::pointer_functor1<int const &,void>::operator()(int& _A_a1 = 1) Line 111 + 0x18 bytes	C++
 	wbpublic.wr.dll!sigc::adaptor_functor<sigc::pointer_functor1<int const &,void> >::operator()<int const &>(int& _A_arg1 = 1) Line 84	C++
 	wbpublic.wr.dll!sigc::internal::slot_call1<sigc::pointer_functor1<int const &,void>,void,int>::call_it(sigc::internal::slot_rep* rep = 0x0DD5F670, int& a_1 = 1) Line 138	C++
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	wbpublic.wr.dll!sigc::slot1<void,int>::operator()(int& _A_a1 = 1) Line 517	C++
 	wbpublic.wr.dll!sigc::adaptor_functor<sigc::slot<void,int,sigc::nil,sigc::nil,sigc::nil,sigc::nil,sigc::nil,sigc::nil> >::operator()<int const &>(int& _A_arg1 = 1) Line 84	C++
 	wbpublic.wr.dll!sigc::internal::slot_call1<sigc::slot<void,int,sigc::nil,sigc::nil,sigc::nil,sigc::nil,sigc::nil,sigc::nil>,void,int const >::call_it(sigc::internal::slot_rep* rep = 0x0DD5A728, int& a_1 = 1) Line 138	C++
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	wbpublic.wr.dll!MySQL::Grt::TreeModel::expand_node(MySQL::Grt::NodeId^ node = 0x019cd480) Line 239 + 0x43 bytes	C++
 	MySQLCsUtilities.dll!MySQL.Grt.GrtTreeModel.TreeViewExpanding(object sender = {Aga.Controls.Tree.TreeViewAdv}, Aga.Controls.Tree.TreeViewAdvEventArgs e = {Aga.Controls.Tree.TreeViewAdvEventArgs}) Line 229 + 0x24 bytes	C#
 	Aga.Controls.dll!Aga.Controls.Tree.TreeViewAdv.OnExpanding(Aga.Controls.Tree.TreeNodeAdv node = {affiliatewiz}) Line 123 + 0x35 bytes	C#
 	Aga.Controls.dll!Aga.Controls.Tree.TreeViewAdv.SetIsExpanded(Aga.Controls.Tree.TreeNodeAdv node = {affiliatewiz}, bool value = true) Line 721 + 0xb bytes	C#
 	Aga.Controls.dll!Aga.Controls.Tree.TreeViewAdv.SetIsExpanded(Aga.Controls.Tree.TreeViewAdv.ExpandArgs eargs = {Aga.Controls.Tree.TreeViewAdv.ExpandArgs}) Line 703 + 0x10 bytes	C#
 	Aga.Controls.dll!Aga.Controls.Tree.TreeViewAdv.SetIsExpanded.AnonymousMethod(object argument = {Aga.Controls.Tree.TreeViewAdv.ExpandArgs}) Line 688 + 0x2e bytes	C#
 	Aga.Controls.dll!Aga.Controls.Threading.AbortableThreadPool.HandleItem.AnonymousMethod() Line 52 + 0x2f bytes	C#
 	mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData) + 0x51 bytes	
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x67 bytes	
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x45 bytes	
 	Aga.Controls.dll!Aga.Controls.Threading.AbortableThreadPool.HandleItem(object ignored = null) Line 51 + 0x7a bytes	C#
 	mscorlib.dll!System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(object state) + 0x2f bytes	
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x6f bytes	
 	mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading._ThreadPoolWaitCallback tpWaitCallBack) + 0x53 bytes	
 	mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(object state) + 0x59 bytes
[16 Mar 2010 14:08] Sergei Tkachenko
Was repeatable for closing QE view by pressing Ctrl-W anytime.
[24 Mar 2010 10:46] Johannes Taxacher
fixed in repository.
[26 Mar 2010 13:22] Tony Bedford
An entry has been added to the 5.2.17 changelog:

If a connection was opened for querying and then Ctrl+W quickly pressed to close the connection, MySQL Workbench would crash.