Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-23073

LSAN: Memory leak after XA transaction with shutdown / rollback to savepoint

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t (a TEXT) ENGINE = InnoDB;
      XA BEGIN 'a';
        INSERT INTO t VALUES (REPEAT('a', 20000));
        SAVEPOINT sp;
        INSERT INTO t VALUES (REPEAT('a', 20000));
        ROLLBACK TO sp;
      XA END 'a';
      XA PREPARE 'a';
      

      =================================================================
      ==30164==ERROR: LeakSanitizer: detected memory leaks
       
      Direct leak of 64 byte(s) in 1 object(s) allocated from:
          #0 0x7fe00701ab40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
          #1 0x55ea93a57cb2 in ut_allocator<unsigned char, true>::allocate(unsigned long, unsigned char const*, unsigned int, bool, bool) /10.5/storage/innobase/include/ut0new.h:374
          #2 0x55ea93f097b6 in trx_savepoint_for_mysql(trx_t*, char const*, long) /10.5/storage/innobase/trx/trx0roll.cc:532
          #3 0x55ea939f05e2 in innobase_savepoint /10.5/storage/innobase/handler/ha_innodb.cc:4776
          #4 0x55ea92f0917f in ha_savepoint(THD*, st_savepoint*) /10.5/sql/handler.cc:2558
          #5 0x55ea92b8f31f in trans_savepoint(THD*, st_mysql_const_lex_string) /10.5/sql/transaction.cc:617
          #6 0x55ea9273bf9b in mysql_execute_command(THD*) /10.5/sql/sql_parse.cc:5653
          #7 0x55ea9274b87a in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /10.5/sql/sql_parse.cc:7987
          #8 0x55ea9272236b in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /10.5/sql/sql_parse.cc:1866
          #9 0x55ea9271ebe9 in do_command(THD*) /10.5/sql/sql_parse.cc:1347
          #10 0x55ea92b4cfc2 in do_handle_one_connection(CONNECT*, bool) /10.5/sql/sql_connect.cc:1411
          #11 0x55ea92b4c91b in handle_one_connection /10.5/sql/sql_connect.cc:1313
          #12 0x55ea938110e4 in pfs_spawn_thread /10.5/storage/perfschema/pfs.cc:2201
          #13 0x7fe0054406da in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
       
      Indirect leak of 35 byte(s) in 1 object(s) allocated from:
          #0 0x7fe00701ab40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
          #1 0x55ea93a57cb2 in ut_allocator<unsigned char, true>::allocate(unsigned long, unsigned char const*, unsigned int, bool, bool) /10.5/storage/innobase/include/ut0new.h:374
          #2 0x55ea93f05d3e in mem_strdup /10.5/storage/innobase/include/mem0mem.ic:450
          #3 0x55ea93f097f1 in trx_savepoint_for_mysql(trx_t*, char const*, long) /10.5/storage/innobase/trx/trx0roll.cc:535
          #4 0x55ea939f05e2 in innobase_savepoint /10.5/storage/innobase/handler/ha_innodb.cc:4776
          #5 0x55ea92f0917f in ha_savepoint(THD*, st_savepoint*) /10.5/sql/handler.cc:2558
          #6 0x55ea92b8f31f in trans_savepoint(THD*, st_mysql_const_lex_string) /10.5/sql/transaction.cc:617
          #7 0x55ea9273bf9b in mysql_execute_command(THD*) /10.5/sql/sql_parse.cc:5653
          #8 0x55ea9274b87a in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /10.5/sql/sql_parse.cc:7987
          #9 0x55ea9272236b in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /10.5/sql/sql_parse.cc:1866
          #10 0x55ea9271ebe9 in do_command(THD*) /10.5/sql/sql_parse.cc:1347
          #11 0x55ea92b4cfc2 in do_handle_one_connection(CONNECT*, bool) /10.5/sql/sql_connect.cc:1411
          #12 0x55ea92b4c91b in handle_one_connection /10.5/sql/sql_connect.cc:1313
          #13 0x55ea938110e4 in pfs_spawn_thread /10.5/storage/perfschema/pfs.cc:2201
          #14 0x7fe0054406da in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
       
      SUMMARY: AddressSanitizer: 99 byte(s) leaked in 2 allocation(s).
      

      with 2 savepoints there will be 198b, etc..

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.