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

Memory leak in Window_func_runner::exec after encountering "temporary space limit reached" error

    XMLWordPrintable

Details

    Description

      SET max_tmp_session_space_usage= 64*1024;
      --error 200
      SELECT MIN(VARIABLE_VALUE) OVER (), NTILE(1) OVER (), MAX(VARIABLE_NAME) OVER () FROM information_schema.SESSION_STATUS;
      

      bb-11.5-MDEV-9101-max-tmp-space-used 06504a2f49a86b24d7492254e8ffe06130895e45 ASAN

      ==1741206==ERROR: LeakSanitizer: detected memory leaks
       
      Direct leak of 96 byte(s) in 3 object(s) allocated from:
          #0 0x7f33f24b94c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
          #1 0x555eb67b2d23 in compute_window_func(THD*, List<Item_window_func>&, List<Cursor_manager>&, TABLE*, SORT_INFO*) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_window.cc:2879
          #2 0x555eb67b398e in Window_func_runner::exec(THD*, TABLE*, SORT_INFO*) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_window.cc:3046
          #3 0x555eb67b3bad in Window_funcs_sort::exec(JOIN*, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_window.cc:3074
          #4 0x555eb67b4a12 in Window_funcs_computation::exec(JOIN*, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_window.cc:3203
          #5 0x555eb624684b in AGGR_OP::end_send() /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:32540
          #6 0x555eb6203e2e in sub_select_postjoin_aggr(JOIN*, st_join_table*, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:23286
          #7 0x555eb620498a in sub_select(JOIN*, st_join_table*, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:23541
          #8 0x555eb6202e33 in do_select /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:23121
          #9 0x555eb61818bc in JOIN::exec_inner() /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:4988
          #10 0x555eb617ecdb in JOIN::exec() /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:4774
          #11 0x555eb6183374 in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:5304
          #12 0x555eb61521b2 in handle_select(THD*, LEX*, select_result*, unsigned long long) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:630
          #13 0x555eb607682a in execute_sqlcom_select /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_parse.cc:6094
          #14 0x555eb6066b42 in mysql_execute_command(THD*, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_parse.cc:3943
          #15 0x555eb6081692 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_parse.cc:7814
          #16 0x555eb6058b25 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_parse.cc:1893
          #17 0x555eb6055845 in do_command(THD*, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_parse.cc:1406
          #18 0x555eb652eafc in do_handle_one_connection(CONNECT*, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_connect.cc:1437
          #19 0x555eb652e4bd in handle_one_connection /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_connect.cc:1339
          #20 0x555eb7173da3 in pfs_spawn_thread /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/storage/perfschema/pfs.cc:2201
          #21 0x7f33f18a8043 in start_thread nptl/pthread_create.c:442
       
      Direct leak of 32 byte(s) in 1 object(s) allocated from:
          #0 0x7f33f24b89cf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69
          #1 0x555eb7d66d54 in my_malloc /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/mysys/my_malloc.c:93
          #2 0x555eb67b2ea4 in compute_window_func(THD*, List<Item_window_func>&, List<Cursor_manager>&, TABLE*, SORT_INFO*) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_window.cc:2887
          #3 0x555eb67b398e in Window_func_runner::exec(THD*, TABLE*, SORT_INFO*) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_window.cc:3046
          #4 0x555eb67b3bad in Window_funcs_sort::exec(JOIN*, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_window.cc:3074
          #5 0x555eb67b4a12 in Window_funcs_computation::exec(JOIN*, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_window.cc:3203
          #6 0x555eb624684b in AGGR_OP::end_send() /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:32540
          #7 0x555eb6203e2e in sub_select_postjoin_aggr(JOIN*, st_join_table*, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:23286
          #8 0x555eb620498a in sub_select(JOIN*, st_join_table*, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:23541
          #9 0x555eb6202e33 in do_select /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:23121
          #10 0x555eb61818bc in JOIN::exec_inner() /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:4988
          #11 0x555eb617ecdb in JOIN::exec() /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:4774
          #12 0x555eb6183374 in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:5304
          #13 0x555eb61521b2 in handle_select(THD*, LEX*, select_result*, unsigned long long) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_select.cc:630
          #14 0x555eb607682a in execute_sqlcom_select /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_parse.cc:6094
          #15 0x555eb6066b42 in mysql_execute_command(THD*, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_parse.cc:3943
          #16 0x555eb6081692 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_parse.cc:7814
          #17 0x555eb6058b25 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_parse.cc:1893
          #18 0x555eb6055845 in do_command(THD*, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_parse.cc:1406
          #19 0x555eb652eafc in do_handle_one_connection(CONNECT*, bool) /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_connect.cc:1437
          #20 0x555eb652e4bd in handle_one_connection /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/sql/sql_connect.cc:1339
          #21 0x555eb7173da3 in pfs_spawn_thread /data/bld/bb-11.5-MDEV-9101-max-tmp-space-used-asan/storage/perfschema/pfs.cc:2201
          #22 0x7f33f18a8043 in start_thread nptl/pthread_create.c:442
       
      SUMMARY: AddressSanitizer: 128 byte(s) leaked in 4 allocation(s).
      

      bb-11.5-monty 8c22c8fa8e4030aa790cc89d89faab45be026ae0 Valgrind

      Warning: Memory not freed: 32
      ==1769340== 32 bytes in 1 blocks are definitely lost in loss record 1 of 3
      ==1769340==    at 0x48407B4: malloc (vg_replace_malloc.c:381)
      ==1769340==    by 0x18E5104: my_malloc (my_malloc.c:93)
      ==1769340==    by 0xEB9399: compute_window_func(THD*, List<Item_window_func>&, List<Cursor_manager>&, TABLE*, SORT_INFO*) (sql_window.cc:2887)
      ==1769340==    by 0xEB9A26: Window_func_runner::exec(THD*, TABLE*, SORT_INFO*) (sql_window.cc:3046)
      ==1769340==    by 0xEB9B15: Window_funcs_sort::exec(JOIN*, bool) (sql_window.cc:3074)
      ==1769340==    by 0xEBA150: Window_funcs_computation::exec(JOIN*, bool) (sql_window.cc:3203)
      ==1769340==    by 0xC528B3: AGGR_OP::end_send() (sql_select.cc:32546)
      ==1769340==    by 0xC38FC5: sub_select_postjoin_aggr(JOIN*, st_join_table*, bool) (sql_select.cc:23292)
      ==1769340==    by 0xC39402: sub_select(JOIN*, st_join_table*, bool) (sql_select.cc:23547)
      ==1769340==    by 0xC388CA: do_select(JOIN*, Procedure*) (sql_select.cc:23127)
      ==1769340==    by 0xC042CA: JOIN::exec_inner() (sql_select.cc:4988)
      ==1769340==    by 0xC032D8: JOIN::exec() (sql_select.cc:4774)
      ==1769340==    by 0xC04D65: mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:5304)
      ==1769340==    by 0xBF2F72: handle_select(THD*, LEX*, select_result*, unsigned long long) (sql_select.cc:630)
      ==1769340==    by 0xB958D8: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:6101)
      ==1769340==    by 0xB8D6B9: mysql_execute_command(THD*, bool) (sql_parse.cc:3948)
      ==1769340== 96 bytes in 3 blocks are definitely lost in loss record 2 of 3
      ==1769340==    at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
      ==1769340==    by 0xEB92C6: compute_window_func(THD*, List<Item_window_func>&, List<Cursor_manager>&, TABLE*, SORT_INFO*) (sql_window.cc:2879)
      ==1769340==    by 0xEB9A26: Window_func_runner::exec(THD*, TABLE*, SORT_INFO*) (sql_window.cc:3046)
      ==1769340==    by 0xEB9B15: Window_funcs_sort::exec(JOIN*, bool) (sql_window.cc:3074)
      ==1769340==    by 0xEBA150: Window_funcs_computation::exec(JOIN*, bool) (sql_window.cc:3203)
      ==1769340==    by 0xC528B3: AGGR_OP::end_send() (sql_select.cc:32546)
      ==1769340==    by 0xC38FC5: sub_select_postjoin_aggr(JOIN*, st_join_table*, bool) (sql_select.cc:23292)
      ==1769340==    by 0xC39402: sub_select(JOIN*, st_join_table*, bool) (sql_select.cc:23547)
      ==1769340==    by 0xC388CA: do_select(JOIN*, Procedure*) (sql_select.cc:23127)
      ==1769340==    by 0xC042CA: JOIN::exec_inner() (sql_select.cc:4988)
      ==1769340==    by 0xC032D8: JOIN::exec() (sql_select.cc:4774)
      ==1769340==    by 0xC04D65: mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:5304)
      ==1769340==    by 0xBF2F72: handle_select(THD*, LEX*, select_result*, unsigned long long) (sql_select.cc:630)
      ==1769340==    by 0xB958D8: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:6101)
      ==1769340==    by 0xB8D6B9: mysql_execute_command(THD*, bool) (sql_parse.cc:3948)
      ==1769340==    by 0xB9A89D: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:7821)
      

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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