List:Commits« Previous MessageNext Message »
From:Marc Alff Date:September 14 2010 10:14pm
Subject:bzr push into mysql-next-mr-bugfixing branch (marc.alff:3286 to 3287)
View as plain text  
 3287 Marc Alff	2010-09-14 [merge]
      Merge mysql-trunk-bugfixing --> mysql-next-mr-bugfixing

    modified:
      mysql-test/valgrind.supp
      sql/mysqld.cc
 3286 Marc Alff	2010-09-13 [merge]
      Merge mysql-trunk-bugfixing --> mysql-next-mr-bugfixing

    modified:
      mysql-test/suite/perfschema/include/upgrade_check.inc
=== modified file 'mysql-test/valgrind.supp'
--- a/mysql-test/valgrind.supp	2010-06-07 09:14:56 +0000
+++ b/mysql-test/valgrind.supp	2010-09-14 21:51: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-08 07:10:51 +0000
+++ b/sql/mysqld.cc	2010-09-14 22:13:37 +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 */
 }
@@ -2729,6 +2735,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 */
@@ -4749,6 +4760,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)
@@ -4766,18 +4786,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-20100914221337-unb3eyy9d76b8vvx.bundle
Thread
bzr push into mysql-next-mr-bugfixing branch (marc.alff:3286 to 3287) Marc Alff15 Sep