Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-5008

Memory leak in sync_latch_meta_init() after mysqld shutdown detected by ASan

Details

    Description

      The following memory leak is detected by ASan during mysqld shutdown

      Direct leak of 144 byte(s) in 1 object(s) allocated from:
          #0 0x7ff095aa7b50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
          #1 0x5585f6447cb8 in ut_allocator<unsigned char>::allocate(unsigned long, unsigned char const*, char const*, bool, bool) (/home/yura/addon/mysql-build-5.7-asan_scope/sql/mysqld-debug+0x29d8cb8)
          #2 0x5585f688b693 in sync_latch_meta_init /mnt/hgfs/repos/mysql-server/storage/innobase/sync/sync0debug.cc:1510
          #3 0x5585f68a5102 in sync_check_init() /mnt/hgfs/repos/mysql-server/storage/innobase/sync/sync0debug.cc:1800
          #4 0x5585f6824ea0 in srv_general_init() /mnt/hgfs/repos/mysql-server/storage/innobase/srv/srv0srv.cc:1085
          #5 0x5585f6827b39 in srv_boot() /mnt/hgfs/repos/mysql-server/storage/innobase/srv/srv0srv.cc:1126
          #6 0x5585f68594d2 in innobase_start_or_create_for_mysql() /mnt/hgfs/repos/mysql-server/storage/innobase/srv/srv0start.cc:1715
          #7 0x5585f6409fb7 in innobase_init /mnt/hgfs/repos/mysql-server/storage/innobase/handler/ha_innodb.cc:4056
          #8 0x5585f47ae36f in ha_initialize_handlerton(st_plugin_int*) /mnt/hgfs/repos/mysql-server/sql/handler.cc:840
          #9 0x5585f5b20c50 in plugin_initialize /mnt/hgfs/repos/mysql-server/sql/sql_plugin.cc:1225
          #10 0x5585f5b25eee in plugin_register_builtin_and_init_core_se(int*, char**) /mnt/hgfs/repos/mysql-server/sql/sql_plugin.cc:1588
          #11 0x5585f464ea67 in init_server_components /mnt/hgfs/repos/mysql-server/sql/mysqld.cc:4074
          #12 0x5585f46520cb in mysqld_main(int, char**) /mnt/hgfs/repos/mysql-server/sql/mysqld.cc:4768
          #13 0x5585f46390c2 in main /mnt/hgfs/repos/mysql-server/sql/main.cc:25
          #14 0x7ff093968b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
      

      How to repeat:
      Build MySQL Server with Address Sanitizer enabled on Ubuntu 18.04 with default GCC (7.3.0)

      cmake ... -DWITH_ASAN=ON -DWITH_ASAN_SCOPE=ON
      

      Run

      ./mtr --debug-server innodb.log_file_name
      

      Output
      mysqltest: At line 39: command "$mysqld" failed with wrong error: 42

      Look at the content of the 'tmp/my_restart.err'

      Attachments

        Issue Links

          Activity

            People

              satya.bodapati Satya Bodapati
              yura.sorokin Yura Sorokin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 5 hours
                  5h

                  Smart Checklist