[Mono-bugs] [Bug 512471] New: mysql/net-connector (all versions) with compress=true crashes mono

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jun 11 18:11:26 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=512471


           Summary: mysql/net-connector (all versions) with compress=true
                    crashes mono
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.4.x
          Platform: x86-64
        OS/Version: openSUSE 11.0
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: post-christian at freenet.de
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=297687)
 --> (http://bugzilla.novell.com/attachment.cgi?id=297687)
MysqlStress.out

The stress test below throws different exceptions or crashes the runtime after
a few seconds. Since it does happen with mono only and the mysql driver is 100%
managed, it could be a mono problem. But i posted it to the mysql bug system
too. The output is attached.

Steps to reproduce the problem:

run the following:

namespace Test {

    using System;
    using System.Collections.Generic;
    using System.Data.Common;
    using System.Text;
    using System.Threading;
    using MySql.Data.MySqlClient;

    class MysqlStress {

        static string connectionString =
            "Host=192.168.0.204;Uid=root;Pwd=secret;Database=test;" +
            "Charset=utf8;Compress=true;Convert Zero Datetime=true"
        ;
        static int maxRows = 100;

        public static void Main( string[] args ) {
            StressMysql();
        }

        public static void StressMysql() {
            MySqlConnection con = new MySqlConnection( connectionString );
            con.Open();
            MySqlCommand cmd = new MySqlCommand();
            cmd.Connection = con;
            cmd.CommandText = "DROP TABLE IF EXISTS t1";
            cmd.ExecuteNonQuery();
            cmd.CommandText =
                @"CREATE TABLE t1 (
                    id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
                    ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
                    dt DATETIME,
                    ch VARCHAR(255) CHARACTER SET utf8,
                    bn VARBINARY(255),
                    tx TEXT CHARACTER SET utf8
                )"
            ;
            cmd.ExecuteNonQuery();
            cmd.CommandText = "INSERT INTO t1 (dt,ch,bn,tx)
VALUES(?dt,?ch,?bn,?tx)";
            cmd.Parameters.Clear();
            cmd.Parameters.Add( "?dt", MySqlDbType.DateTime );
            cmd.Parameters.Add( "?ch", MySqlDbType.VarChar );
            cmd.Parameters.Add( "?bn", MySqlDbType.VarBinary );
            cmd.Parameters.Add( "?tx", MySqlDbType.Text );
            cmd.Prepare();
            for( int i = 1; i <= maxRows; i++ ) {
                cmd.Parameters[0].Value = DateTime.Now;
                cmd.Parameters[1].Value = i.ToString() + new String( 'X', 200
);
                cmd.Parameters[2].Value = Encoding.ASCII.GetBytes( i.ToString()
+ new String( 'X', 200 ) );
                cmd.Parameters[3].Value = new String( 'X', 16384 );
                cmd.ExecuteNonQuery();
                Console.WriteLine( "insert row {0}", i );
            }
            List<Thread> threads = new List<Thread>();
            for( int i = 1; i <= 10; i++ ) {
                Thread thread = new Thread(
                    new ThreadStart( StressMysqlThread ) );
                thread.Start();
                threads.Add( thread );
            }
            while( true ) {
                Thread.Sleep( 1000 );
            }
        }

        public static void StressMysqlThread() {
            MySqlConnection con = new MySqlConnection( connectionString );
            con.Open();
            while( true ) {
                MySqlCommand cmd = new MySqlCommand();
                Random rand = new Random();
                cmd.Connection = con;
                cmd.CommandText = "SELECT * FROM t1 WHERE id > " + rand.Next(
maxRows - 1 );
                Console.WriteLine( cmd.CommandText );
                DbDataReader res = cmd.ExecuteReader();
                Dictionary<string, object> row = new
Dictionary<string,object>();
                while( res.Read() ) {
                    row.Clear();
                    for( int i = 0; i < res.FieldCount; i++ )
                        row[res.GetName( i )] = res[i];
                }
                res.Close();
                Thread.Sleep( rand.Next( 1000 ) );
            }
        }
    }
}

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list