Bug #43190 | MySqlConnection.Open breaks debugging in Visual Studio 2005/2008 | ||
---|---|---|---|
Submitted: | 25 Feb 2009 14:38 | Modified: | 17 Mar 2009 16:57 |
Reporter: | Juergen Steinblock | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 5.2.5.0 | OS: | Windows (XP / Vista) |
Assigned to: | CPU Architecture: | Any | |
Tags: | connector.net, debugging, MySql.Data |
[25 Feb 2009 14:38]
Juergen Steinblock
[25 Feb 2009 14:57]
Juergen Steinblock
Please note: If I enable the Application Framework not event the workaround has an effect.
[25 Feb 2009 18:59]
Tonci Grgin
Hi Juergen and thanks for your report. I'm having troubles understanding the procedure... - Debug your app Does this mean I should start it from VS2005 IDE or should I attach with WinDBG, for example? - Click button1, a exception should be thrown If I'm in IDE by clicking this button I loose any other option but to break debugging session... - Click button2, and after the messagebox is shown, click button1, which causes the form to close and the debugging session ends. As I said in previous point, following your instructions in IDE *never* get's me to this point... However, running executable shows no problems like you reported but then again, that is not a debug session... So, how to test this behavior?
[26 Feb 2009 7:23]
Juergen Steinblock
I know the error seems a bit strange and is hard to discribe. What I ment was to start the app from within visual studio (to get debugging functionality) and to try it for two times. Let's modify the code a bit: --------------------------------------------- private void button1_Click(object sender, EventArgs e) { using (MySqlConnection con = new MySqlConnection("server=localhost;database=mysql;uid=root")) { MessageBox.Show(con.State.ToString()); throw new Exception("This exception causes the debugger to break here"); } } - Add code to button2 click event to open a mysql connection (i.e.): private void button2_Click(object sender, EventArgs e) { using (MySqlConnection con = new MySqlConnection("server=localhost;database=mysql;uid=root")) { con.Open(); MessageBox.Show(con.State.ToString()); throw new Exception("This exception causes the app to close"); } } --------------------------------------------- If I click on button1 the exception is throw within the IDE but if I start another debug session the app closes without any further warning or error. As you can see, this happen only if I call the con.Open() method. One thing to mention, I tracked the date since this happens down to 2008/12/18 (this is where we noticed it)
[26 Feb 2009 7:31]
Juergen Steinblock
If I compile this example with csc command line tool and use coredbg to debug, this is the output: button1 click (throws an exception as it should be): ---------------------------------------------------- (cordbg) go Warning: couldn't load symbols for C:\Windows\assembly\GAC_MSIL\Accessibility\2. 0.0.0__b03f5f7f11d50a3a\Accessibility.dll Warning: couldn't load symbols for C:\Windows\assembly\GAC_MSIL\mscorlib.resourc es\2.0.0.0_de_b77a5c561934e089\mscorlib.resources.dll Warning: couldn't load symbols for C:\temp\mysql\MySql.Data.dll Warning: couldn't load symbols for C:\Windows\assembly\GAC_32\System.Data\2.0.0. 0__b77a5c561934e089\System.Data.dll Warning: couldn't load symbols for C:\Windows\assembly\GAC_32\System.Transaction s\2.0.0.0__b77a5c561934e089\System.Transactions.dll First chance exception generated: (0x1faa590) <System.Exception> Unhandled exception generated: (0x1faa590) <System.Exception> _className=<null> _exceptionMethod=<null> _exceptionMethodString=<null> _message=<null> _data=<null> _innerException=<null> _helpURL=<null> _stackTrace=(0x1faa770) <System.SByte[]> _stackTraceString=<null> _remoteStackTraceString=<null> _remoteStackIndex=0 _dynamicMethods=<null> _HResult=-2146233088 _source=<null> _xptrs=0 _xcode=-532459699 Exception is called:UNHANDLED 024: throw new Exception(); ---------------------------------------------------- button2 click (Debugging stops and program closes): ---------------------------------------------------- (cordbg) go Warning: couldn't load symbols for C:\Windows\assembly\GAC_MSIL\Accessibility\2. 0.0.0__b03f5f7f11d50a3a\Accessibility.dll Warning: couldn't load symbols for C:\Windows\assembly\GAC_MSIL\mscorlib.resourc es\2.0.0.0_de_b77a5c561934e089\mscorlib.resources.dll Warning: couldn't load symbols for C:\temp\mysql\MySql.Data.dll Warning: couldn't load symbols for C:\Windows\assembly\GAC_32\System.Data\2.0.0. 0__b77a5c561934e089\System.Data.dll Warning: couldn't load symbols for C:\Windows\assembly\GAC_32\System.Transaction s\2.0.0.0__b77a5c561934e089\System.Transactions.dll Warning: couldn't load symbols for C:\Windows\assembly\GAC_MSIL\System.Configura tion\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll Warning: couldn't load symbols for C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0 .0__b77a5c561934e089\System.Xml.dll [thread 0x64c] Thread created. Warning: couldn't load symbols for C:\Windows\assembly\GAC_32\System.EnterpriseS ervices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll First chance exception generated: (0x20938a4) <System.Exception> ExceptionUnwind is called: AppDomain: Program.exe TID : 0x1318 EventType: UNWIND_BEGIN Process exited. ----------------------------------------------------
[17 Mar 2009 16:57]
Juergen Steinblock
Ticket can be considered as closed. It was hard work but I was able to track the bug down to MySql.Data.Common.StreamCreator.GetHostEntry(string hostname) which is called within connection.Open() The line of code that actually breaks debugging is: if (IPAddress.TryParse(hostname, out addr)) which belongs to the framework so I moved this bug to Microsoft Connect https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=424433