List:Commits« Previous MessageNext Message »
From:Marc Alff Date:September 14 2010 9:42pm
Subject:bzr push into mysql-5.5-bugfixing branch (marc.alff:3205)
View as plain text  
 3205 Marc Alff	2010-09-14 [merge]
      Local merge

    modified:
      client/mysqltest.cc
      libmysqld/lib_sql.cc
      mysql-test/include/default_mysqld.cnf
      mysql-test/r/func_time.result
      mysql-test/r/parser.result
      mysql-test/r/select.result
      mysql-test/r/strict.result
      mysql-test/r/type_datetime.result
      mysql-test/suite/perfschema/include/upgrade_check.inc
      mysql-test/suite/perfschema/r/start_server_no_cond_class.result
      mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
      mysql-test/suite/perfschema/r/start_server_no_file_class.result
      mysql-test/suite/perfschema/r/start_server_no_file_inst.result
      mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
      mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
      mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
      mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
      mysql-test/suite/perfschema/r/start_server_no_thread_class.result
      mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
      mysql-test/suite/perfschema/r/start_server_off.result
      mysql-test/suite/perfschema/r/start_server_on.result
      mysql-test/t/strict.test
      mysql-test/t/type_datetime.test
      mysys/my_gethwaddr.c
      mysys/my_sync.c
      sql/derror.cc
      sql/item_timefunc.cc
      sql/item_timefunc.h
      sql/mysqld.cc
      sql/set_var.cc
      sql/set_var.h
      sql/sys_vars.h
      storage/perfschema/ha_perfschema.cc
=== modified file 'mysql-test/valgrind.supp'
--- a/mysql-test/valgrind.supp	2010-06-07 08:47:04 +0000
+++ b/mysql-test/valgrind.supp	2010-09-09 21:33:35 +0000
@@ -745,3 +745,28 @@
    Memcheck:Addr1
    fun:buf_buddy_relocate
 }
+
+#
+# See related Bug#56666
+# Race condition between the server main thread and the kill server thread.
+#
+# Because of this race condition, the call to shutdown_performance_schema()
+# was commented in sql/mysqld.cc, causing the reported leaks.
+#
+
+{
+   missing shutdown_performance_schema 1
+   Memcheck:Leak
+   fun:malloc
+   fun:_Z10pfs_mallocmi
+}
+
+{
+   missing shutdown_performance_schema 2
+   Memcheck:Leak
+   fun:malloc
+   fun:my_malloc
+   fun:_lf_alloc_new
+   fun:lf_hash_insert
+}
+

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2010-09-02 18:37:04 +0000
+++ b/sql/mysqld.cc	2010-09-14 21:40:50 +0000
@@ -1395,6 +1395,12 @@ static void mysqld_exit(int exit_code)
   mysql_audit_finalize();
   clean_up_mutexes();
   clean_up_error_log_mutex();
+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
+  /*
+    Bug#56666 needs to be fixed before calling:
+    shutdown_performance_schema();
+  */
+#endif
   my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
   exit(exit_code); /* purecov: inspected */
 }
@@ -2733,6 +2739,11 @@ pthread_handler_t signal_hand(void *arg
       if (!abort_loop)
       {
 	abort_loop=1;				// mark abort for threads
+#ifdef HAVE_PSI_INTERFACE
+        /* Delete the instrumentation for the signal thread */
+        if (likely(PSI_server != NULL))
+          PSI_server->delete_current_thread();
+#endif
 #ifdef USE_ONE_SIGNAL_HAND
 	pthread_t tmp;
         if (mysql_thread_create(0, /* Not instrumented */
@@ -4588,6 +4599,15 @@ int mysqld_main(int argc, char **argv)
 #endif
 #endif /* __WIN__ */
 
+#ifdef HAVE_PSI_INTERFACE
+  /*
+    Disable the main thread instrumentation,
+    to avoid recording events during the shutdown.
+  */
+  if (PSI_server)
+    PSI_server->delete_current_thread();
+#endif
+
   /* Wait until cleanup is done */
   mysql_mutex_lock(&LOCK_thread_count);
   while (!ready_to_exit)
@@ -4605,18 +4625,6 @@ int mysqld_main(int argc, char **argv)
   }
 #endif
   clean_up(1);
-#ifdef HAVE_PSI_INTERFACE
-  /*
-    Disable the instrumentation, to avoid recording events
-    during the shutdown.
-  */
-  if (PSI_server)
-  {
-    PSI_server->delete_current_thread();
-    PSI_server= NULL;
-  }
-  shutdown_performance_schema();
-#endif
   mysqld_exit(0);
 }
 


Attachment: [text/bzr-bundle] bzr/marc.alff@oracle.com-20100914214050-w2lztu1rdywtf1tv.bundle
Thread
bzr push into mysql-5.5-bugfixing branch (marc.alff:3205) Marc Alff14 Sep