From: Marc Alff Date: March 8 2011 12:42pm Subject: bzr commit into mysql-5.5 branch (marc.alff:3377) Bug#11830755 List-Archive: http://lists.mysql.com/commits/132590 X-Bug: 11830755 Message-Id: <201103081243.p27MT06b014406@acsinet15.oracle.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6320544489976219960==" --===============6320544489976219960== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///Users/malff/BZR_TREE/mysql-5.5-bug11830755/ based on revid:jon.hauglid@stripped 3377 Marc Alff 2011-03-08 Bug#11830755 - UNIT TESTS PFS_INSTR AND PFS_INSTR_CLASS CRASH IN MUTEX CALLS ON WINDOWS Before this fix, two performance schema unit tests crashed on windows. The problem was a missing initialization to PFS_atomics, which caused the crash only for platform not compiled with native atomics. This fix adds the missing initialization in the unit tests. No production code was changed, this is a unit test bug only. modified: storage/perfschema/unittest/pfs-t.cc storage/perfschema/unittest/pfs_instr-oom-t.cc storage/perfschema/unittest/pfs_instr-t.cc storage/perfschema/unittest/pfs_instr_class-oom-t.cc storage/perfschema/unittest/pfs_instr_class-t.cc storage/perfschema/unittest/pfs_timer-t.cc === modified file 'storage/perfschema/unittest/pfs-t.cc' --- a/storage/perfschema/unittest/pfs-t.cc 2010-11-16 08:36:42 +0000 +++ b/storage/perfschema/unittest/pfs-t.cc 2011-03-08 12:42:00 +0000 @@ -1205,6 +1205,8 @@ void test_enabled() void do_all_tests() { + /* Using initialize_performance_schema(), no partial init needed. */ + test_bootstrap(); test_bad_registration(); test_init_disabled(); === modified file 'storage/perfschema/unittest/pfs_instr-oom-t.cc' --- a/storage/perfschema/unittest/pfs_instr-oom-t.cc 2010-11-16 08:36:42 +0000 +++ b/storage/perfschema/unittest/pfs_instr-oom-t.cc 2011-03-08 12:42:00 +0000 @@ -199,7 +199,11 @@ void test_oom() void do_all_tests() { + PFS_atomic::init(); + test_oom(); + + PFS_atomic::cleanup(); } int main(int, char **) === modified file 'storage/perfschema/unittest/pfs_instr-t.cc' --- a/storage/perfschema/unittest/pfs_instr-t.cc 2010-11-16 08:36:42 +0000 +++ b/storage/perfschema/unittest/pfs_instr-t.cc 2011-03-08 12:42:00 +0000 @@ -400,10 +400,14 @@ void test_per_thread_wait() void do_all_tests() { + PFS_atomic::init(); + test_no_instruments(); test_no_instances(); test_with_instances(); test_per_thread_wait(); + + PFS_atomic::cleanup(); } int main(int, char **) === modified file 'storage/perfschema/unittest/pfs_instr_class-oom-t.cc' --- a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc 2010-11-16 08:36:42 +0000 +++ b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc 2011-03-08 12:42:00 +0000 @@ -47,7 +47,11 @@ void test_oom() void do_all_tests() { + PFS_atomic::init(); + test_oom(); + + PFS_atomic::cleanup(); } int main(int, char **) === modified file 'storage/perfschema/unittest/pfs_instr_class-t.cc' --- a/storage/perfschema/unittest/pfs_instr_class-t.cc 2010-11-16 08:36:42 +0000 +++ b/storage/perfschema/unittest/pfs_instr_class-t.cc 2011-03-08 12:42:00 +0000 @@ -554,6 +554,8 @@ void test_instruments_reset() void do_all_tests() { + PFS_atomic::init(); + test_no_registration(); test_mutex_registration(); test_rwlock_registration(); @@ -562,6 +564,8 @@ void do_all_tests() test_file_registration(); test_table_registration(); test_instruments_reset(); + + PFS_atomic::cleanup(); } int main(int, char **) === modified file 'storage/perfschema/unittest/pfs_timer-t.cc' --- a/storage/perfschema/unittest/pfs_timer-t.cc 2010-07-15 23:44:45 +0000 +++ b/storage/perfschema/unittest/pfs_timer-t.cc 2011-03-08 12:42:00 +0000 @@ -105,7 +105,11 @@ void test_timers() void do_all_tests() { + PFS_atomic::init(); + test_timers(); + + PFS_atomic::cleanup(); } int main(int, char **) --===============6320544489976219960== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/marc.alff@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: marc.alff@stripped # target_branch: file:///Users/malff/BZR_TREE/mysql-5.5-bug11830755/ # testament_sha1: a7ae314cef9b6f6cd4cedb88373f18319fd59cd0 # timestamp: 2011-03-08 13:42:09 +0100 # base_revision_id: jon.hauglid@stripped\ # 68fza9cbh78002fr # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWaRn1/8ABMnfgAAQWHf//39n 3sC////wYAed9Y+4AelUM7s4GjKR6aIMiDUm1NCAGED0m1AAyBpoxqeoAlKNBptJlMKPUG1AAANA AA0Ac0ZMTABMRgRpgQYjBMmARgzVJE9T9EyjJ6npHqAABggDQeoAAikJU/Kn5Jo008gmhkRphGaR oaBoAAkiAgTBNAE0jRpQepoPU/VD1GQAfqlc4lS1zUKmoWoWR0RAAEPTVq1q6I2q5PcnaGpmcrKk 2W26uLCSaInmYNzmPdfczPS7k6RO6O/YXWnSmAgBAgQO3xoqm+JYX4YNO/I8F2ChGZtSGZmmeHI5 DFCqPjM0Ie3fczYOruUdO4CMXjjxtWPz34Ph+Fz3ICg/dSfMdeoxbTSDKVVcn2rGB2ws6uJW0VAL SohJUth1tHx5snGtXLkpWpqqQWBj1gwdOollBEEAJzZL0omzo7lNs8/ZdsplS0d8fUQGlB1yENDg AcOIg6WeeXn8Gca8rBRzoWya9JEADyEK5fLRJ7Ii5CqHfyRmKqE7CV7BGEgCG0AYAYQa0OihSSEh 0UEDM4gyHJwa6ChWaQNO061e2JSNsysWGs8h1B0gkiq8FgglOwQ6cp7o9Uf6xvp+Fo2GYSbJnbdF 0bvn/IJgL2uSCEw8F/7aAKLCCaPb6TpjLgwgquBAAvt4WNk0NNYmcsxMcQHoIOeVN3PZcbtEPDUp 6SL6lfjZUiT2bEWJofIQfArE4nSv/rTojejVhV30cjBEGAIndIRAQOmJZD9zqfWBPTUuEEQDI7DG A+OmwxPh2uSggoMZrqAXvc7tlgQSCMXjzYK1wsHlrpXmCzDEJxR1ZM4U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