Bug #28413 slow program exit when using libmysql.dll together with .NET Framework Forms
Submitted: 14 May 2007 12:37 Modified: 30 May 2008 7:08
Reporter: Manfred Wiedemeier Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S3 (Non-critical)
Version:5.0.41 OS:Windows (Vista and XP)
Assigned to: CPU Architecture:Any

[14 May 2007 12:37] Manfred Wiedemeier
Description:
Slow program exit when using libmysql.dll together with .NET Framework 2.0 Forms. It seems as if the main thread is waiting for somethings.

Form1 is empty, no controls on it. 

Without "Application.Run (new Form1());" everything is ok.
Without libmysql everything is ok.

Any suggestions?

How to repeat:
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace WindowsApplication1
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            IntPtr mysql = libmysql.mysql_init (IntPtr.Zero);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run (new Form1());
            
            libmysql.mysql_close (mysql);
            libmysql.mysql_server_end();
        }
    };

    static public class libmysql {
        [DllImport ("libmysql.dll")]
        public static extern IntPtr mysql_init (IntPtr mysql);

        [DllImport ("libmysql.dll")]
        public static extern void mysql_close (IntPtr mysql);

        [DllImport("libmysql.dll")]
        public static extern void mysql_server_end();
    };

};
[15 May 2007 10:28] Sveta Smirnova
Thank you for the report.

There is packaging bug #28358 only occured in version 5.0.41. Please test your case with previous version to see if the cause is that bug.
[16 May 2007 9:00] Manfred Wiedemeier
I check it with 5.0.37 and 5.0.41, under Windows XP and Vista.
[16 May 2007 9:03] Sveta Smirnova
Thank you for the feedback.

But what was the result?
[16 May 2007 14:38] Sergei Golubchik
same as bug#25621 ?
[11 Jun 2007 8:24] Manfred Wiedemeier
Same behavior with 5.0.37 and 5.0.41, under Windows XP and Vista.
Seems like a thread won't exit.
[6 Aug 2007 12:16] Tonci Grgin
Hi Manfred. I have to agree with Sergei, this sure looks like Bug#25621... Can you please add "logging=true" to your connection string and check on <your_host_name>.err file (in Data directory) to see if this is indeed same problem?
[6 Sep 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[30 May 2008 4:45] Louis Solomon
this sounds similar to the problem PHP users are having ... http://bugs.php.net/bug.php?id=41350
[30 May 2008 7:08] Tonci Grgin
This is a duplicate of Bug#25621, Bug#32366 ...

I don't see the need of posting my own words from Bug#25621 here again. Especially since I personally tested PHP part of bug there and found it fixed (wait for PHP 5.2.6).