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

Memory leaks after INSERT .. RETURNING with subquery

    XMLWordPrintable

Details

    Description

      CREATE TABLE t (a INT);
      INSERT INTO t SELECT 1 FROM DUAL WHERE 2 IN (SELECT 3 UNION SELECT 4) RETURNING a;
       
      # Cleanup
      DROP TABLE t;
      

      10.5 9abc6fd7 non-debug ASAN

      Warning: Memory not freed: 120
       
      =================================================================
      ==2557170==ERROR: LeakSanitizer: detected memory leaks
       
      Indirect leak of 2936 byte(s) in 1 object(s) allocated from:
          #0 0x7f401a53bbc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
          #1 0x560726a693ac in my_malloc /data/src/10.5/mysys/my_malloc.c:90
          #2 0x560726a5525d in alloc_root /data/src/10.5/mysys/my_alloc.c:244
          #3 0x560726a5563f in multi_alloc_root /data/src/10.5/mysys/my_alloc.c:317
          #4 0x5607250ab736 in Create_tmp_table::start(THD*, TMP_TABLE_PARAM*, st_mysql_const_lex_string const*) /data/src/10.5/sql/sql_select.cc:18508
          #5 0x5607250c9b6e in create_tmp_table(THD*, TMP_TABLE_PARAM*, List<Item>&, st_order*, bool, bool, unsigned long long, unsigned long long, st_mysql_const_lex_string const*, bool, bool) /data/src/10.5/sql/sql_select.cc:19349
          #6 0x5607252545fd in select_unit::create_result_table(THD*, List<Item>*, bool, unsigned long long, st_mysql_const_lex_string const*, bool, bool, bool, unsigned int) /data/src/10.5/sql/sql_union.cc:329
          #7 0x56072526dac8 in st_select_lex_unit::prepare(TABLE_LIST*, select_result*, unsigned long long) /data/src/10.5/sql/sql_union.cc:1755
          #8 0x5607259c88b1 in subselect_union_engine::prepare(THD*) /data/src/10.5/sql/item_subselect.cc:3881
          #9 0x5607259c6eab in Item_subselect::fix_fields(THD*, Item**) /data/src/10.5/sql/item_subselect.cc:289
          #10 0x5607259c7f29 in Item_in_subselect::fix_fields(THD*, Item**) /data/src/10.5/sql/item_subselect.cc:3525
          #11 0x560724e5f86c in Item::fix_fields_if_needed(THD*, Item**) /data/src/10.5/sql/item.h:988
          #12 0x560724e5f86c in Item::fix_fields_if_needed(THD*, Item**) /data/src/10.5/sql/item.h:986
          #13 0x560724e5f86c in Item::fix_fields_if_needed_for_scalar(THD*, Item**) /data/src/10.5/sql/item.h:992
          #14 0x560724e5f86c in Item::fix_fields_if_needed_for_bool(THD*, Item**) /data/src/10.5/sql/item.h:996
          #15 0x560724e5f86c in setup_conds(THD*, TABLE_LIST*, List<TABLE_LIST>&, Item**) /data/src/10.5/sql/sql_base.cc:8384
          #16 0x5607250f6eb0 in setup_without_group /data/src/10.5/sql/sql_select.cc:722
          #17 0x5607250f6eb0 in JOIN::prepare(TABLE_LIST*, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*) /data/src/10.5/sql/sql_select.cc:1274
          #18 0x560725140256 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/src/10.5/sql/sql_select.cc:4726
          #19 0x560725140eef in handle_select(THD*, LEX*, select_result*, unsigned long) /data/src/10.5/sql/sql_select.cc:443
          #20 0x560724fdb2b2 in mysql_execute_command(THD*) /data/src/10.5/sql/sql_parse.cc:4774
          #21 0x560724f9518c in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.5/sql/sql_parse.cc:8101
          #22 0x560724fc273a in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.5/sql/sql_parse.cc:1891
          #23 0x560724fc99fa in do_command(THD*) /data/src/10.5/sql/sql_parse.cc:1370
          #24 0x56072536b6ec in do_handle_one_connection(CONNECT*, bool) /data/src/10.5/sql/sql_connect.cc:1410
          #25 0x56072536c284 in handle_one_connection /data/src/10.5/sql/sql_connect.cc:1312
          #26 0x560725f676c8 in pfs_spawn_thread /data/src/10.5/storage/perfschema/pfs.cc:2201
          #27 0x7f4019f3c608 in start_thread /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477
       
      Indirect leak of 1488 byte(s) in 1 object(s) allocated from:
          #0 0x7f401a53bbc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
          #1 0x560726a693ac in my_malloc /data/src/10.5/mysys/my_malloc.c:90
          #2 0x56072613e289 in heap_create /data/src/10.5/storage/heap/hp_create.c:162
          #3 0x56072612cbd5 in ha_heap::open(char const*, int, unsigned int) /data/src/10.5/storage/heap/ha_heap.cc:104
          #4 0x5607256d6ef3 in handler::ha_open(TABLE*, char const*, int, unsigned int, st_mem_root*, List<String>*) /data/src/10.5/sql/handler.cc:2983
          #5 0x5607250b0177 in open_tmp_table(TABLE*) /data/src/10.5/sql/sql_select.cc:19552
          #6 0x5607250c8b8d in Create_tmp_table::finalize(THD*, TABLE*, TMP_TABLE_PARAM*, bool, bool) /data/src/10.5/sql/sql_select.cc:19257
          #7 0x5607250c9bcd in create_tmp_table(THD*, TMP_TABLE_PARAM*, List<Item>&, st_order*, bool, bool, unsigned long long, unsigned long long, st_mysql_const_lex_string const*, bool, bool) /data/src/10.5/sql/sql_select.cc:19351
          #8 0x5607252545fd in select_unit::create_result_table(THD*, List<Item>*, bool, unsigned long long, st_mysql_const_lex_string const*, bool, bool, bool, unsigned int) /data/src/10.5/sql/sql_union.cc:329
          #9 0x56072526dac8 in st_select_lex_unit::prepare(TABLE_LIST*, select_result*, unsigned long long) /data/src/10.5/sql/sql_union.cc:1755
          #10 0x5607259c88b1 in subselect_union_engine::prepare(THD*) /data/src/10.5/sql/item_subselect.cc:3881
          #11 0x5607259c6eab in Item_subselect::fix_fields(THD*, Item**) /data/src/10.5/sql/item_subselect.cc:289
          #12 0x5607259c7f29 in Item_in_subselect::fix_fields(THD*, Item**) /data/src/10.5/sql/item_subselect.cc:3525
          #13 0x560724e5f86c in Item::fix_fields_if_needed(THD*, Item**) /data/src/10.5/sql/item.h:988
          #14 0x560724e5f86c in Item::fix_fields_if_needed(THD*, Item**) /data/src/10.5/sql/item.h:986
          #15 0x560724e5f86c in Item::fix_fields_if_needed_for_scalar(THD*, Item**) /data/src/10.5/sql/item.h:992
          #16 0x560724e5f86c in Item::fix_fields_if_needed_for_bool(THD*, Item**) /data/src/10.5/sql/item.h:996
          #17 0x560724e5f86c in setup_conds(THD*, TABLE_LIST*, List<TABLE_LIST>&, Item**) /data/src/10.5/sql/sql_base.cc:8384
          #18 0x5607250f6eb0 in setup_without_group /data/src/10.5/sql/sql_select.cc:722
          #19 0x5607250f6eb0 in JOIN::prepare(TABLE_LIST*, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*) /data/src/10.5/sql/sql_select.cc:1274
          #20 0x560725140256 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/src/10.5/sql/sql_select.cc:4726
          #21 0x560725140eef in handle_select(THD*, LEX*, select_result*, unsigned long) /data/src/10.5/sql/sql_select.cc:443
          #22 0x560724fdb2b2 in mysql_execute_command(THD*) /data/src/10.5/sql/sql_parse.cc:4774
          #23 0x560724f9518c in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.5/sql/sql_parse.cc:8101
          #24 0x560724fc273a in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.5/sql/sql_parse.cc:1891
          #25 0x560724fc99fa in do_command(THD*) /data/src/10.5/sql/sql_parse.cc:1370
          #26 0x56072536b6ec in do_handle_one_connection(CONNECT*, bool) /data/src/10.5/sql/sql_connect.cc:1410
          #27 0x56072536c284 in handle_one_connection /data/src/10.5/sql/sql_connect.cc:1312
          #28 0x560725f676c8 in pfs_spawn_thread /data/src/10.5/storage/perfschema/pfs.cc:2201
          #29 0x7f4019f3c608 in start_thread /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477
       
      Indirect leak of 1336 byte(s) in 1 object(s) allocated from:
          #0 0x7f401a53bbc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
          #1 0x560726a693ac in my_malloc /data/src/10.5/mysys/my_malloc.c:90
          #2 0x560726a5525d in alloc_root /data/src/10.5/mysys/my_alloc.c:244
          #3 0x5607261290c3 in Sql_alloc::operator new(unsigned long, st_mem_root*) /data/src/10.5/sql/sql_alloc.h:39
          #4 0x5607261290c3 in heap_create_handler /data/src/10.5/storage/heap/ha_heap.cc:65
          #5 0x5607256cea0c in get_new_handler(TABLE_SHARE*, st_mem_root*, handlerton*) /data/src/10.5/sql/handler.cc:375
          #6 0x5607250c56cb in Create_tmp_table::finalize(THD*, TABLE*, TMP_TABLE_PARAM*, bool, bool) /data/src/10.5/sql/sql_select.cc:18837
          #7 0x5607250c9bcd in create_tmp_table(THD*, TMP_TABLE_PARAM*, List<Item>&, st_order*, bool, bool, unsigned long long, unsigned long long, st_mysql_const_lex_string const*, bool, bool) /data/src/10.5/sql/sql_select.cc:19351
          #8 0x5607252545fd in select_unit::create_result_table(THD*, List<Item>*, bool, unsigned long long, st_mysql_const_lex_string const*, bool, bool, bool, unsigned int) /data/src/10.5/sql/sql_union.cc:329
          #9 0x56072526dac8 in st_select_lex_unit::prepare(TABLE_LIST*, select_result*, unsigned long long) /data/src/10.5/sql/sql_union.cc:1755
          #10 0x5607259c88b1 in subselect_union_engine::prepare(THD*) /data/src/10.5/sql/item_subselect.cc:3881
          #11 0x5607259c6eab in Item_subselect::fix_fields(THD*, Item**) /data/src/10.5/sql/item_subselect.cc:289
          #12 0x5607259c7f29 in Item_in_subselect::fix_fields(THD*, Item**) /data/src/10.5/sql/item_subselect.cc:3525
          #13 0x560724e5f86c in Item::fix_fields_if_needed(THD*, Item**) /data/src/10.5/sql/item.h:988
          #14 0x560724e5f86c in Item::fix_fields_if_needed(THD*, Item**) /data/src/10.5/sql/item.h:986
          #15 0x560724e5f86c in Item::fix_fields_if_needed_for_scalar(THD*, Item**) /data/src/10.5/sql/item.h:992
          #16 0x560724e5f86c in Item::fix_fields_if_needed_for_bool(THD*, Item**) /data/src/10.5/sql/item.h:996
          #17 0x560724e5f86c in setup_conds(THD*, TABLE_LIST*, List<TABLE_LIST>&, Item**) /data/src/10.5/sql/sql_base.cc:8384
          #18 0x5607250f6eb0 in setup_without_group /data/src/10.5/sql/sql_select.cc:722
          #19 0x5607250f6eb0 in JOIN::prepare(TABLE_LIST*, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*) /data/src/10.5/sql/sql_select.cc:1274
          #20 0x560725140256 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/src/10.5/sql/sql_select.cc:4726
          #21 0x560725140eef in handle_select(THD*, LEX*, select_result*, unsigned long) /data/src/10.5/sql/sql_select.cc:443
          #22 0x560724fdb2b2 in mysql_execute_command(THD*) /data/src/10.5/sql/sql_parse.cc:4774
          #23 0x560724f9518c in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.5/sql/sql_parse.cc:8101
          #24 0x560724fc273a in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.5/sql/sql_parse.cc:1891
          #25 0x560724fc99fa in do_command(THD*) /data/src/10.5/sql/sql_parse.cc:1370
          #26 0x56072536b6ec in do_handle_one_connection(CONNECT*, bool) /data/src/10.5/sql/sql_connect.cc:1410
          #27 0x56072536c284 in handle_one_connection /data/src/10.5/sql/sql_connect.cc:1312
          #28 0x560725f676c8 in pfs_spawn_thread /data/src/10.5/storage/perfschema/pfs.cc:2201
          #29 0x7f4019f3c608 in start_thread /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477
       
      Indirect leak of 1008 byte(s) in 1 object(s) allocated from:
          #0 0x7f401a53bbc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
          #1 0x560726a693ac in my_malloc /data/src/10.5/mysys/my_malloc.c:90
          #2 0x560726a5525d in alloc_root /data/src/10.5/mysys/my_alloc.c:244
          #3 0x5607254e1aeb in Field::operator new(unsigned long, st_mem_root*) /data/src/10.5/sql/field.h:761
          #4 0x5607254a517e in Type_handler_long::make_table_field_from_def(TABLE_SHARE*, st_mem_root*, st_mysql_const_lex_string const*, Record_addr const&, Bit_addr const&, Column_definition_attributes const*, unsigned int) const /data/src/10.5/sql/sql_type.cc:8129
          #5 0x56072549639a in Type_handler_int_result::make_table_field(st_mem_root*, st_mysql_const_lex_string const*, Record_addr const&, Type_all_attributes const&, TABLE_SHARE*) const /data/src/10.5/sql/sql_type.cc:3561
          #6 0x5607254cfc71 in Type_handler::make_and_init_table_field(st_mem_root*, st_mysql_const_lex_string const*, Record_addr const&, Type_all_attributes const&, TABLE*) const /data/src/10.5/sql/sql_type.cc:3546
          #7 0x56072576bc23 in Item_type_holder::create_tmp_field_ex(st_mem_root*, TABLE*, Tmp_field_src*, Tmp_field_param const*) /data/src/10.5/sql/item.h:7384
          #8 0x5607250aa5a4 in create_tmp_field(TABLE*, Item*, Item***, Field**, Field**, bool, bool, bool, bool) /data/src/10.5/sql/sql_select.cc:18225
          #9 0x5607250acd07 in Create_tmp_table::add_fields(THD*, TABLE*, TMP_TABLE_PARAM*, List<Item>&) /data/src/10.5/sql/sql_select.cc:18713
          #10 0x5607250c9ba0 in create_tmp_table(THD*, TMP_TABLE_PARAM*, List<Item>&, st_order*, bool, bool, unsigned long long, unsigned long long, st_mysql_const_lex_string const*, bool, bool) /data/src/10.5/sql/sql_select.cc:19350
          #11 0x5607252545fd in select_unit::create_result_table(THD*, List<Item>*, bool, unsigned long long, st_mysql_const_lex_string const*, bool, bool, bool, unsigned int) /data/src/10.5/sql/sql_union.cc:329
          #12 0x56072526dac8 in st_select_lex_unit::prepare(TABLE_LIST*, select_result*, unsigned long long) /data/src/10.5/sql/sql_union.cc:1755
          #13 0x5607259c88b1 in subselect_union_engine::prepare(THD*) /data/src/10.5/sql/item_subselect.cc:3881
          #14 0x5607259c6eab in Item_subselect::fix_fields(THD*, Item**) /data/src/10.5/sql/item_subselect.cc:289
          #15 0x5607259c7f29 in Item_in_subselect::fix_fields(THD*, Item**) /data/src/10.5/sql/item_subselect.cc:3525
          #16 0x560724e5f86c in Item::fix_fields_if_needed(THD*, Item**) /data/src/10.5/sql/item.h:988
          #17 0x560724e5f86c in Item::fix_fields_if_needed(THD*, Item**) /data/src/10.5/sql/item.h:986
          #18 0x560724e5f86c in Item::fix_fields_if_needed_for_scalar(THD*, Item**) /data/src/10.5/sql/item.h:992
          #19 0x560724e5f86c in Item::fix_fields_if_needed_for_bool(THD*, Item**) /data/src/10.5/sql/item.h:996
          #20 0x560724e5f86c in setup_conds(THD*, TABLE_LIST*, List<TABLE_LIST>&, Item**) /data/src/10.5/sql/sql_base.cc:8384
          #21 0x5607250f6eb0 in setup_without_group /data/src/10.5/sql/sql_select.cc:722
          #22 0x5607250f6eb0 in JOIN::prepare(TABLE_LIST*, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*) /data/src/10.5/sql/sql_select.cc:1274
          #23 0x560725140256 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/src/10.5/sql/sql_select.cc:4726
          #24 0x560725140eef in handle_select(THD*, LEX*, select_result*, unsigned long) /data/src/10.5/sql/sql_select.cc:443
          #25 0x560724fdb2b2 in mysql_execute_command(THD*) /data/src/10.5/sql/sql_parse.cc:4774
          #26 0x560724f9518c in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.5/sql/sql_parse.cc:8101
          #27 0x560724fc273a in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.5/sql/sql_parse.cc:1891
          #28 0x560724fc99fa in do_command(THD*) /data/src/10.5/sql/sql_parse.cc:1370
          #29 0x56072536b6ec in do_handle_one_connection(CONNECT*, bool) /data/src/10.5/sql/sql_connect.cc:1410
          #30 0x56072536c284 in handle_one_connection /data/src/10.5/sql/sql_connect.cc:1312
          #31 0x560725f676c8 in pfs_spawn_thread /data/src/10.5/storage/perfschema/pfs.cc:2201
          #32 0x7f4019f3c608 in start_thread /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477
       
      Indirect leak of 768 byte(s) in 1 object(s) allocated from:
          #0 0x7f401a53bbc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
          #1 0x560726a693ac in my_malloc /data/src/10.5/mysys/my_malloc.c:90
          #2 0x56072613621a in heap_open_from_share /data/src/10.5/storage/heap/hp_open.c:33
          #3 0x56072612ccdf in ha_heap::open(char const*, int, unsigned int) /data/src/10.5/storage/heap/ha_heap.cc:111
          #4 0x5607256d6ef3 in handler::ha_open(TABLE*, char const*, int, unsigned int, st_mem_root*, List<String>*) /data/src/10.5/sql/handler.cc:2983
          #5 0x5607250b0177 in open_tmp_table(TABLE*) /data/src/10.5/sql/sql_select.cc:19552
          #6 0x5607250c8b8d in Create_tmp_table::finalize(THD*, TABLE*, TMP_TABLE_PARAM*, bool, bool) /data/src/10.5/sql/sql_select.cc:19257
          #7 0x5607250c9bcd in create_tmp_table(THD*, TMP_TABLE_PARAM*, List<Item>&, st_order*, bool, bool, unsigned long long, unsigned long long, st_mysql_const_lex_string const*, bool, bool) /data/src/10.5/sql/sql_select.cc:19351
          #8 0x5607252545fd in select_unit::create_result_table(THD*, List<Item>*, bool, unsigned long long, st_mysql_const_lex_string const*, bool, bool, bool, unsigned int) /data/src/10.5/sql/sql_union.cc:329
          #9 0x56072526dac8 in st_select_lex_unit::prepare(TABLE_LIST*, select_result*, unsigned long long) /data/src/10.5/sql/sql_union.cc:1755
          #10 0x5607259c88b1 in subselect_union_engine::prepare(THD*) /data/src/10.5/sql/item_subselect.cc:3881
          #11 0x5607259c6eab in Item_subselect::fix_fields(THD*, Item**) /data/src/10.5/sql/item_subselect.cc:289
          #12 0x5607259c7f29 in Item_in_subselect::fix_fields(THD*, Item**) /data/src/10.5/sql/item_subselect.cc:3525
          #13 0x560724e5f86c in Item::fix_fields_if_needed(THD*, Item**) /data/src/10.5/sql/item.h:988
          #14 0x560724e5f86c in Item::fix_fields_if_needed(THD*, Item**) /data/src/10.5/sql/item.h:986
          #15 0x560724e5f86c in Item::fix_fields_if_needed_for_scalar(THD*, Item**) /data/src/10.5/sql/item.h:992
          #16 0x560724e5f86c in Item::fix_fields_if_needed_for_bool(THD*, Item**) /data/src/10.5/sql/item.h:996
          #17 0x560724e5f86c in setup_conds(THD*, TABLE_LIST*, List<TABLE_LIST>&, Item**) /data/src/10.5/sql/sql_base.cc:8384
          #18 0x5607250f6eb0 in setup_without_group /data/src/10.5/sql/sql_select.cc:722
          #19 0x5607250f6eb0 in JOIN::prepare(TABLE_LIST*, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*) /data/src/10.5/sql/sql_select.cc:1274
          #20 0x560725140256 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/src/10.5/sql/sql_select.cc:4726
          #21 0x560725140eef in handle_select(THD*, LEX*, select_result*, unsigned long) /data/src/10.5/sql/sql_select.cc:443
          #22 0x560724fdb2b2 in mysql_execute_command(THD*) /data/src/10.5/sql/sql_parse.cc:4774
          #23 0x560724f9518c in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.5/sql/sql_parse.cc:8101
          #24 0x560724fc273a in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.5/sql/sql_parse.cc:1891
          #25 0x560724fc99fa in do_command(THD*) /data/src/10.5/sql/sql_parse.cc:1370
          #26 0x56072536b6ec in do_handle_one_connection(CONNECT*, bool) /data/src/10.5/sql/sql_connect.cc:1410
          #27 0x56072536c284 in handle_one_connection /data/src/10.5/sql/sql_connect.cc:1312
          #28 0x560725f676c8 in pfs_spawn_thread /data/src/10.5/storage/perfschema/pfs.cc:2201
          #29 0x7f4019f3c608 in start_thread /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477
       
      Indirect leak of 120 byte(s) in 1 object(s) allocated from:
          #0 0x7f401a53bbc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
          #1 0x560726a693ac in my_malloc /data/src/10.5/mysys/my_malloc.c:90
          #2 0x560726a69962 in my_strdup /data/src/10.5/mysys/my_malloc.c:233
          #3 0x56072613ec72 in heap_create /data/src/10.5/storage/heap/hp_create.c:226
          #4 0x56072612cbd5 in ha_heap::open(char const*, int, unsigned int) /data/src/10.5/storage/heap/ha_heap.cc:104
          #5 0x5607256d6ef3 in handler::ha_open(TABLE*, char const*, int, unsigned int, st_mem_root*, List<String>*) /data/src/10.5/sql/handler.cc:2983
          #6 0x5607250b0177 in open_tmp_table(TABLE*) /data/src/10.5/sql/sql_select.cc:19552
          #7 0x5607250c8b8d in Create_tmp_table::finalize(THD*, TABLE*, TMP_TABLE_PARAM*, bool, bool) /data/src/10.5/sql/sql_select.cc:19257
          #8 0x5607250c9bcd in create_tmp_table(THD*, TMP_TABLE_PARAM*, List<Item>&, st_order*, bool, bool, unsigned long long, unsigned long long, st_mysql_const_lex_string const*, bool, bool) /data/src/10.5/sql/sql_select.cc:19351
          #9 0x5607252545fd in select_unit::create_result_table(THD*, List<Item>*, bool, unsigned long long, st_mysql_const_lex_string const*, bool, bool, bool, unsigned int) /data/src/10.5/sql/sql_union.cc:329
          #10 0x56072526dac8 in st_select_lex_unit::prepare(TABLE_LIST*, select_result*, unsigned long long) /data/src/10.5/sql/sql_union.cc:1755
          #11 0x5607259c88b1 in subselect_union_engine::prepare(THD*) /data/src/10.5/sql/item_subselect.cc:3881
          #12 0x5607259c6eab in Item_subselect::fix_fields(THD*, Item**) /data/src/10.5/sql/item_subselect.cc:289
          #13 0x5607259c7f29 in Item_in_subselect::fix_fields(THD*, Item**) /data/src/10.5/sql/item_subselect.cc:3525
          #14 0x560724e5f86c in Item::fix_fields_if_needed(THD*, Item**) /data/src/10.5/sql/item.h:988
          #15 0x560724e5f86c in Item::fix_fields_if_needed(THD*, Item**) /data/src/10.5/sql/item.h:986
          #16 0x560724e5f86c in Item::fix_fields_if_needed_for_scalar(THD*, Item**) /data/src/10.5/sql/item.h:992
          #17 0x560724e5f86c in Item::fix_fields_if_needed_for_bool(THD*, Item**) /data/src/10.5/sql/item.h:996
          #18 0x560724e5f86c in setup_conds(THD*, TABLE_LIST*, List<TABLE_LIST>&, Item**) /data/src/10.5/sql/sql_base.cc:8384
          #19 0x5607250f6eb0 in setup_without_group /data/src/10.5/sql/sql_select.cc:722
          #20 0x5607250f6eb0 in JOIN::prepare(TABLE_LIST*, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*) /data/src/10.5/sql/sql_select.cc:1274
          #21 0x560725140256 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/src/10.5/sql/sql_select.cc:4726
          #22 0x560725140eef in handle_select(THD*, LEX*, select_result*, unsigned long) /data/src/10.5/sql/sql_select.cc:443
          #23 0x560724fdb2b2 in mysql_execute_command(THD*) /data/src/10.5/sql/sql_parse.cc:4774
          #24 0x560724f9518c in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.5/sql/sql_parse.cc:8101
          #25 0x560724fc273a in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.5/sql/sql_parse.cc:1891
          #26 0x560724fc99fa in do_command(THD*) /data/src/10.5/sql/sql_parse.cc:1370
          #27 0x56072536b6ec in do_handle_one_connection(CONNECT*, bool) /data/src/10.5/sql/sql_connect.cc:1410
          #28 0x56072536c284 in handle_one_connection /data/src/10.5/sql/sql_connect.cc:1312
          #29 0x560725f676c8 in pfs_spawn_thread /data/src/10.5/storage/perfschema/pfs.cc:2201
          #30 0x7f4019f3c608 in start_thread /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477
       
      SUMMARY: AddressSanitizer: 7656 byte(s) leaked in 6 allocation(s).
      210422 15:44:38 [ERROR] mysqld got signal 6 ;
      This could be because you hit a bug. It is also possible that this binary
      or one of the libraries it was linked against is corrupt, improperly built,
      or misconfigured. This error can also be caused by malfunctioning hardware.
       
      To report this bug, see https://mariadb.com/kb/en/reporting-bugs
       
      We will try our best to scrape up some info that will hopefully help
      diagnose the problem, but since we have already crashed, 
      something is definitely wrong and this may fail.
       
      Server version: 10.5.10-MariaDB-log
      read_buffer_size=131072
      max_used_connections=1
      thread_count=0
      Thread pointer: 0x0
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 0x0 thread_stack 0x5fc00
      ??:0(__interceptor_tcgetattr)[0x7f401a49ad30]
      mysys/stacktrace.c:213(my_print_stacktrace)[0x560726a72916]
      sql/signal_handler.cc:221(handle_fatal_signal)[0x5607256c5e44]
      sigaction.c:0(__restore_rt)[0x7f4019f483c0]
      ??:0(gsignal)[0x7f4019a3418b]
      ??:0(abort)[0x7f4019a13859]
      ??:0(__sanitizer_set_report_fd)[0x7f401a5596a2]
      ??:0(__sanitizer_get_module_and_offset_for_pc)[0x7f401a56424c]
      ??:0(__lsan_do_recoverable_leak_check)[0x7f401a569b9c]
      ??:0(__lsan_enable)[0x7f401a5693dd]
      ??:0(__cxa_finalize)[0x7f4019a3815e]
      /lib/x86_64-linux-gnu/libasan.so.5(+0x22be7)[0x7f401a450be7]
      The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
      information that should help you find out what is causing the crash.
      Writing a core file...
      Working directory at /dev/shm/var_auto_femX/mysqld.1/data
      Resource Limits:
      Fatal signal 11 while backtracing
      

      10.5 9abc6fd7

      mariadbd: /data/src/10.5/sql/sql_class.cc:1760: virtual THD::~THD(): Assertion `status_var.local_memory_used == 0 || !debug_assert_on_not_freed_memory' failed.
      210422 15:45:46 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f008cdf0f36 in __GI___assert_fail (assertion=0x559ed5f26500 "status_var.local_memory_used == 0 || !debug_assert_on_not_freed_memory", file=0x559ed5f25fd0 "/data/src/10.5/sql/sql_class.cc", line=1760, function=0x559ed5f264a6 "virtual THD::~THD()") at assert.c:101
      #8  0x0000559ed50d6a34 in THD::~THD (this=0x7f006c000db8, __in_chrg=<optimized out>) at /data/src/10.5/sql/sql_class.cc:1760
      #9  0x0000559ed50d6c6e in THD::~THD (this=0x7f006c000db8, __in_chrg=<optimized out>) at /data/src/10.5/sql/sql_class.cc:1766
      #10 0x0000559ed52fdd80 in do_handle_one_connection (connect=0x0, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1451
      #11 0x0000559ed52fd93a in handle_one_connection (arg=0x559ed8822c18) at /data/src/10.5/sql/sql_connect.cc:1312
      #12 0x0000559ed5861ca3 in pfs_spawn_thread (arg=0x559ed891b978) at /data/src/10.5/storage/perfschema/pfs.cc:2201
      #13 0x00007f008d308609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #14 0x00007f008cedc293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
       
      Query (0x0): (null)
      Connection ID (thread ID): 7
      Status: KILL_CONNECTION
      

      Reproducible on 10.5, 10.6.
      Not applicable to previous versions due to the use of INSERT .. RETURNING.

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.