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

Memory leak when using GTT table on sphinx

    XMLWordPrintable

Details

    • Can result in unexpected behaviour

    Description

      INSTALL SONAME 'ha_sphinx';
      CREATE GLOBAL TEMPORARY TABLE t (c1 BIGINT,c2 BIGINT,c3 TEXT NOT NULL,KEY k(c3)) ENGINE=sphinx ON COMMIT DELETE ROWS;
      INSERT t VALUES (0);
      SHUTDOWN;
      

      Leads to:

      MDEV-35915 CS 12.2.0 228260ead7d9343e81a6d73bc0eb7ec96718d917 (Debug, UBASAN, Clang 21.1.3-20250923) Build 27/12/2025

      ==2427955==ERROR: LeakSanitizer: detected memory leaks
       
      Direct leak of 8 byte(s) in 1 object(s) allocated from:
          #0 0x5d3dc47f6391 in operator new(unsigned long) (/test/MDEV-35915_v9_UBASAN_MD271225-mariadb-12.2.0-linux-x86_64-dbg/bin/mariadbd+0x3be0391) (BuildId: 7f11495be59e36864e7725fab8d210105f35e511)
          #1 0x74e4953a0ed7  (<unknown module>)
          #2 0x74e4953a139d  (<unknown module>)
          #3 0x5d3dc48df849 in handler::ha_open(TABLE*, char const*, int, unsigned int, st_mem_root*, List<String>*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/handler.cc:3700:12
          #4 0x5d3dc5e63013 in open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/table.cc:4717:33
          #5 0x5d3dc5cdbe59 in open_global_temporary_table(THD*, TABLE_SHARE*, TABLE_LIST*, MDL_ticket*, Open_table_context*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_table.cc:6265:9
          #6 0x5d3dc53049ea in open_table(THD*, TABLE_LIST*, Open_table_context*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_base.cc:2335:22
          #7 0x5d3dc53196af in open_and_process_table(THD*, TABLE_LIST*, unsigned int*, unsigned int, Prelocking_strategy*, bool, Open_table_context*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_base.cc:4293:14
          #8 0x5d3dc53196af in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_base.cc:4776:14
          #9 0x5d3dc5329931 in open_and_lock_tables(THD*, DDL_options_st const&, TABLE_LIST*, bool, unsigned int, Prelocking_strategy*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_base.cc:5764:7
          #10 0x5d3dc4df3ec4 in open_and_lock_tables(THD*, TABLE_LIST*, bool, unsigned int) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_base.h:544:10
          #11 0x5d3dc569fff6 in mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item>>&, List<Item>&, List<Item>&, enum_duplicates, bool, select_result*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_insert.cc:789:9
          #12 0x5d3dc581b91e in mysql_execute_command(THD*, bool) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:4476:10
          #13 0x5d3dc57f09a8 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:7911:18
          #14 0x5d3dc57ea161 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:1898:7
          #15 0x5d3dc57f2dda in do_command(THD*, bool) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:1437:17
          #16 0x5d3dc5ff73dc in do_handle_one_connection(CONNECT*, bool) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_connect.cc:1414:11
          #17 0x5d3dc5ff6ee5 in handle_one_connection /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_connect.cc:1326:5
          #18 0x5d3dc47afa8a in asan_thread_start(void*) crtstuff.c
       
      Indirect leak of 263264 byte(s) in 1 object(s) allocated from:
          #0 0x5d3dc47f6391 in operator new(unsigned long) (/test/MDEV-35915_v9_UBASAN_MD271225-mariadb-12.2.0-linux-x86_64-dbg/bin/mariadbd+0x3be0391) (BuildId: 7f11495be59e36864e7725fab8d210105f35e511)
          #1 0x74e4953a0eee  (<unknown module>)
          #2 0x74e4953a139d  (<unknown module>)
          #3 0x5d3dc48df849 in handler::ha_open(TABLE*, char const*, int, unsigned int, st_mem_root*, List<String>*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/handler.cc:3700:12
          #4 0x5d3dc5e63013 in open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/table.cc:4717:33
          #5 0x5d3dc5cdbe59 in open_global_temporary_table(THD*, TABLE_SHARE*, TABLE_LIST*, MDL_ticket*, Open_table_context*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_table.cc:6265:9
          #6 0x5d3dc53049ea in open_table(THD*, TABLE_LIST*, Open_table_context*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_base.cc:2335:22
          #7 0x5d3dc53196af in open_and_process_table(THD*, TABLE_LIST*, unsigned int*, unsigned int, Prelocking_strategy*, bool, Open_table_context*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_base.cc:4293:14
          #8 0x5d3dc53196af in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_base.cc:4776:14
          #9 0x5d3dc5329931 in open_and_lock_tables(THD*, DDL_options_st const&, TABLE_LIST*, bool, unsigned int, Prelocking_strategy*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_base.cc:5764:7
          #10 0x5d3dc4df3ec4 in open_and_lock_tables(THD*, TABLE_LIST*, bool, unsigned int) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_base.h:544:10
          #11 0x5d3dc569fff6 in mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item>>&, List<Item>&, List<Item>&, enum_duplicates, bool, select_result*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_insert.cc:789:9
          #12 0x5d3dc581b91e in mysql_execute_command(THD*, bool) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:4476:10
          #13 0x5d3dc57f09a8 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:7911:18
          #14 0x5d3dc57ea161 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:1898:7
          #15 0x5d3dc57f2dda in do_command(THD*, bool) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:1437:17
          #16 0x5d3dc5ff73dc in do_handle_one_connection(CONNECT*, bool) /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_connect.cc:1414:11
          #17 0x5d3dc5ff6ee5 in handle_one_connection /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_connect.cc:1326:5
          #18 0x5d3dc47afa8a in asan_thread_start(void*) crtstuff.c
       
      SUMMARY: AddressSanitizer: 263272 byte(s) leaked in 2 allocation(s).
      251229 13:05:43 [ERROR] /test/MDEV-35915_v9_UBASAN_MD271225-mariadb-12.2.0-linux-x86_64-dbg/bin/mariadbd got signal 6 ;
      

      MDEV-35915 CS 12.2.0 228260ead7d9343e81a6d73bc0eb7ec96718d917 (Optimized, UBASAN, Clang 21.1.3-20250923) Build 27/12/2025

      ==2431668==ERROR: LeakSanitizer: detected memory leaks
       
      Direct leak of 8 byte(s) in 1 object(s) allocated from:
          #0 0x56952db903d1 in operator new(unsigned long) (/test/MDEV-35915_v9_UBASAN_MD271225-mariadb-12.2.0-linux-x86_64-opt/bin/mariadbd+0x30133d1) (BuildId: 36fa81a16067ba38044d96ac0e7bc8372d20deb9)
          #1 0x6e3dc6b9e7f3  (<unknown module>)
          #2 0x6e3dc6b9ebcc  (<unknown module>)
          #3 0x56952dc62450 in handler::ha_open(TABLE*, char const*, int, unsigned int, st_mem_root*, List<String>*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/handler.cc:3700:12
          #4 0x56952f207af2 in open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/table.cc:4717:33
          #5 0x56952f074a81 in open_global_temporary_table(THD*, TABLE_SHARE*, TABLE_LIST*, MDL_ticket*, Open_table_context*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_table.cc:6265:9
          #6 0x56952e67ec58 in open_table(THD*, TABLE_LIST*, Open_table_context*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_base.cc:2335:22
          #7 0x56952e692d43 in open_and_process_table(THD*, TABLE_LIST*, unsigned int*, unsigned int, Prelocking_strategy*, bool, Open_table_context*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_base.cc:4293:14
          #8 0x56952e692d43 in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_base.cc:4776:14
          #9 0x56952e6a10f5 in open_and_lock_tables(THD*, DDL_options_st const&, TABLE_LIST*, bool, unsigned int, Prelocking_strategy*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_base.cc:5764:7
          #10 0x56952e150303 in open_and_lock_tables(THD*, TABLE_LIST*, bool, unsigned int) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_base.h:544:10
          #11 0x56952ea19d0d in mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item>>&, List<Item>&, List<Item>&, enum_duplicates, bool, select_result*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_insert.cc:789:9
          #12 0x56952eb8dd14 in mysql_execute_command(THD*, bool) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_parse.cc:4476:10
          #13 0x56952eb697e5 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_parse.cc:7911:18
          #14 0x56952eb619ad in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_parse.cc:1898:7
          #15 0x56952eb6b720 in do_command(THD*, bool) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_parse.cc:1437:17
          #16 0x56952f3961bc in do_handle_one_connection(CONNECT*, bool) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_connect.cc:1414:11
          #17 0x56952f395cd6 in handle_one_connection /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_connect.cc:1326:5
          #18 0x56952db49aca in asan_thread_start(void*) crtstuff.c
       
      Indirect leak of 263264 byte(s) in 1 object(s) allocated from:
          #0 0x56952db903d1 in operator new(unsigned long) (/test/MDEV-35915_v9_UBASAN_MD271225-mariadb-12.2.0-linux-x86_64-opt/bin/mariadbd+0x30133d1) (BuildId: 36fa81a16067ba38044d96ac0e7bc8372d20deb9)
          #1 0x6e3dc6b9e80e  (<unknown module>)
          #2 0x6e3dc6b9ebcc  (<unknown module>)
          #3 0x56952dc62450 in handler::ha_open(TABLE*, char const*, int, unsigned int, st_mem_root*, List<String>*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/handler.cc:3700:12
          #4 0x56952f207af2 in open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/table.cc:4717:33
          #5 0x56952f074a81 in open_global_temporary_table(THD*, TABLE_SHARE*, TABLE_LIST*, MDL_ticket*, Open_table_context*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_table.cc:6265:9
          #6 0x56952e67ec58 in open_table(THD*, TABLE_LIST*, Open_table_context*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_base.cc:2335:22
          #7 0x56952e692d43 in open_and_process_table(THD*, TABLE_LIST*, unsigned int*, unsigned int, Prelocking_strategy*, bool, Open_table_context*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_base.cc:4293:14
          #8 0x56952e692d43 in open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_base.cc:4776:14
          #9 0x56952e6a10f5 in open_and_lock_tables(THD*, DDL_options_st const&, TABLE_LIST*, bool, unsigned int, Prelocking_strategy*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_base.cc:5764:7
          #10 0x56952e150303 in open_and_lock_tables(THD*, TABLE_LIST*, bool, unsigned int) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_base.h:544:10
          #11 0x56952ea19d0d in mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item>>&, List<Item>&, List<Item>&, enum_duplicates, bool, select_result*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_insert.cc:789:9
          #12 0x56952eb8dd14 in mysql_execute_command(THD*, bool) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_parse.cc:4476:10
          #13 0x56952eb697e5 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_parse.cc:7911:18
          #14 0x56952eb619ad in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_parse.cc:1898:7
          #15 0x56952eb6b720 in do_command(THD*, bool) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_parse.cc:1437:17
          #16 0x56952f3961bc in do_handle_one_connection(CONNECT*, bool) /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_connect.cc:1414:11
          #17 0x56952f395cd6 in handle_one_connection /test/bb-12.2-nikita-global-tmp_opt_san/sql/sql_connect.cc:1326:5
          #18 0x56952db49aca in asan_thread_start(void*) crtstuff.c
       
      SUMMARY: AddressSanitizer: 263272 byte(s) leaked in 2 allocation(s).
      251229 13:05:44 [ERROR] /test/MDEV-35915_v9_UBASAN_MD271225-mariadb-12.2.0-linux-x86_64-opt/bin/mariadbd got signal 6 ;
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.