From: Jon Olav Hauglid Date: August 26 2010 3:40pm Subject: bzr push into mysql-trunk-bugfixing branch (jon.hauglid:3241 to 3242) Bug#56241 List-Archive: http://lists.mysql.com/commits/116917 X-Bug: 56241 Message-Id: <201008261540.o7QFewBl011966@acsinet15.oracle.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7797054681831016596==" --===============7797054681831016596== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 3242 Jon Olav Hauglid 2010-08-26 Bug #56241 Valgrind/CDB warnings for many tests in trunk-bugfixing The reason for the warnings was that the performance schema instrumentation function release_table_share() could be called on a TABLE_SHARE that had already been free'd. The bug was introduced during merging of the patch for Bug#52044 from mysql-5.5-bugfixing (which does not include the call to PSI release_table_share()) to mysql-trunk-bugfixing. This patch fixes the problem by moving the release_table_share() call to TABLE_SHARE::destroy() before the TABLE_SHARE is free'd. No test case added as this problem is detected by existing valgrind tests. modified: sql/table.cc 3241 Marc Alff 2010-08-26 [merge] Merge mysql-5.5-bugfixing --> mysql-trunk-bugfixing added: mysql-test/suite/perfschema/r/bad_option_3.result mysql-test/suite/perfschema/r/bad_option_4.result mysql-test/suite/perfschema/r/bad_option_5.result mysql-test/suite/perfschema/r/short_option_1.result mysql-test/suite/perfschema/r/short_option_2.result mysql-test/suite/perfschema/t/bad_option_3.test mysql-test/suite/perfschema/t/bad_option_4.test mysql-test/suite/perfschema/t/bad_option_5.test mysql-test/suite/perfschema/t/short_option_1-master.opt mysql-test/suite/perfschema/t/short_option_1.test mysql-test/suite/perfschema/t/short_option_2-master.opt mysql-test/suite/perfschema/t/short_option_2.test modified: mysys/my_getopt.c sql/set_var.cc === modified file 'sql/table.cc' --- a/sql/table.cc 2010-08-20 08:48:59 +0000 +++ b/sql/table.cc 2010-08-26 15:17:35 +0000 @@ -426,6 +426,12 @@ void TABLE_SHARE::destroy() info_it->flags= 0; } } + +#ifdef HAVE_PSI_INTERFACE + if (likely(PSI_server && m_psi)) + PSI_server->release_table_share(m_psi); +#endif + /* Make a copy since the share is allocated in its own root, and free_root() updates its argument after freeing the memory. @@ -477,12 +483,6 @@ void free_table_share(TABLE_SHARE *share for this thread to do the work. */ } - -#ifdef HAVE_PSI_INTERFACE - if (likely(PSI_server && share->m_psi)) - PSI_server->release_table_share(share->m_psi); -#endif - DBUG_VOID_RETURN; } --===============7797054681831016596== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/jon.hauglid@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: jon.hauglid@stripped # target_branch: file:///export/home/x/mysql-trunk-bugfixing-test/ # testament_sha1: e0c459b44e7867d6fedfc7b564c31c9525948a93 # timestamp: 2010-08-26 17:40:21 +0200 # source_branch: file:///export/home/x/mysql-5.5-bugfixing-test/ # base_revision_id: marc.alff@stripped\ # n7pgguk55sxo8bzv # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWVdCD3wAAdPfgEAQWeP//391 3QC////wUATmve7zz2e5r293ZTt5jqGST0mJNMTIyYVP1T1NqZNNB6nqegMiaep5QwkkmQ01PTUw gJPRNqZNNAGQNGgABoJoRJsnpTJjUxN6iDQAAANAAkihpqjyTaRtQ0ZGmZQaANAGgA0EkSJk8ppt Rok8xU/U1Myj1BoAAaNADN1Uo7UpwennWLLLateELSrYoICqKgEt0HLfRtwXtp0DOgUM9Z64tPdI iIfTyHFXhBRcGVRtEVGXLyyb6rYKrz/rlXWgk769nweodHWyqI44uU6c+9ZbS162LPVayMxd7HCJ 0MqiV8Y0TRSys4iqbbB0d/TjhguOwsQh9uoXMlNiBGDtPP5U+h2sMBFxsxmwwtvRxDJieN5tkQH3 x3NaqxK4BXF6JYZIJY23RxFoKgdYBlIoEqRNYKTE412gWugLSgYzhOIBc80GAWZKhiV0HyuWarm+ R6l+bnCo/EUi3Vieo0uvJ2nC+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