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

Memory not freed after failed INSERT DELAYED

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (a VARCHAR(1)) ENGINE=MyISAM;
      ALTER TABLE t1 ADD b BLOB DEFAULT 'x';
      --error ER_DATA_TOO_LONG
      INSERT DELAYED INTO t1 (a) VALUES ('foo');
       
      # Cleanup
      DROP TABLE t1;
      

      10.2 dfe8ef8b valgrind

      Warning: Memory not freed: 32
      ==794415== 32 bytes in 1 blocks are definitely lost in loss record 1 of 2
      ==794415==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==794415==    by 0x1742638: my_malloc (my_malloc.c:88)
      ==794415==    by 0xB0B362: Binary_string::real_alloc(unsigned long) (sql_string.cc:44)
      ==794415==    by 0x8E8D52: Binary_string::alloc(unsigned long) (sql_string.h:639)
      ==794415==    by 0xD77B20: Field_blob::store(char const*, unsigned long, charset_info_st const*) (field.cc:8591)
      ==794415==    by 0xDBCE3C: Item::save_str_value_in_field(Field*, String*) (item.cc:406)
      ==794415==    by 0xDD1BAD: Item_string::save_in_field(Field*, bool) (item.cc:6675)
      ==794415==    by 0xB7BF99: TABLE::update_default_fields(bool) (table.cc:8707)
      ==794415==    by 0x98322E: fill_record(THD*, TABLE*, List<Item>&, List<Item>&, bool, bool) (sql_base.cc:8507)
      ==794415==    by 0x98375B: fill_record_n_invoke_before_triggers(THD*, TABLE*, List<Item>&, List<Item>&, bool, trg_event_type) (sql_base.cc:8642)
      ==794415==    by 0x9D05EF: mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool, select_result*) (sql_insert.cc:996)
      ==794415==    by 0xA24FB3: mysql_execute_command(THD*) (sql_parse.cc:4587)
      ==794415==    by 0xA30D6B: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:8042)
      ==794415==    by 0xA1CBFC: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:1872)
      ==794415==    by 0xA1B3F0: do_command(THD*) (sql_parse.cc:1353)
      ==794415==    by 0xBCFA34: do_handle_one_connection(CONNECT*, bool) (sql_connect.cc:1410)
      ==794415==    by 0xBCF797: handle_one_connection (sql_connect.cc:1312)
      ==794415==    by 0x114AE80: pfs_spawn_thread (pfs.cc:2201)
      ==794415==    by 0x4C31608: start_thread (pthread_create.c:477)
      ==794415==    by 0x50C0292: clone (clone.S:95)
      

      10.2 dfe8ef8b normal debug

      Warning: Memory not freed: 8
      Warning:    8 bytes lost at 0x7f1084010e70, allocated by T@0 at sql/sql_string.cc:45, sql/sql_string.h:361, sql/field.cc:8297, sql/item.cc:480, sql/item.cc:6440, sql/table.cc:7845, sql/sql_base.cc:8107, sql/sql_base.cc:8241
      Warning:    8 bytes lost at 0x7f1084010e70, allocated by T@0 at sql/sql_string.cc:45, sql/sql_string.h:361, sql/field.cc:8297, sql/item.cc:480, sql/item.cc:6440, sql/table.cc:7845, sql/sql_base.cc:8107, sql/sql_base.cc:8241
      

      10.2 dfe8ef8b non-debug ASAN

      ==794670==ERROR: LeakSanitizer: detected memory leaks
       
      Direct leak of 16 byte(s) in 1 object(s) allocated from:
          #0 0x7f0f0fd09bc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
          #1 0x56124e3ea9e6 in my_malloc /data/src/10.2/mysys/my_malloc.c:101
          #2 0x56124cf10c13 in String::real_alloc(unsigned long) /data/src/10.2/sql/sql_string.cc:45
          #3 0x56124d2c03be in String::alloc(unsigned long) /data/src/10.2/sql/sql_string.h:361
          #4 0x56124d2c03be in Field_blob::store(char const*, unsigned int, charset_info_st const*) /data/src/10.2/sql/field.cc:8297
          #5 0x56124cfebccb in TABLE::update_default_fields(bool) /data/src/10.2/sql/table.cc:7845
          #6 0x56124cc59f2b in fill_record(THD*, TABLE*, List<Item>&, List<Item>&, bool, bool) /data/src/10.2/sql/sql_base.cc:8108
          #7 0x56124cc5aa9d in fill_record_n_invoke_before_triggers(THD*, TABLE*, List<Item>&, List<Item>&, bool, trg_event_type) /data/src/10.2/sql/sql_base.cc:8241
          #8 0x56124ccf722c in mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) /data/src/10.2/sql/sql_insert.cc:966
          #9 0x56124cd40e59 in mysql_execute_command(THD*) /data/src/10.2/sql/sql_parse.cc:4193
          #10 0x56124cd58d9f in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.2/sql/sql_parse.cc:7762
          #11 0x56124cd627b3 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.2/sql/sql_parse.cc:1827
          #12 0x56124cd67135 in do_command(THD*) /data/src/10.2/sql/sql_parse.cc:1381
          #13 0x56124d066476 in do_handle_one_connection(CONNECT*) /data/src/10.2/sql/sql_connect.cc:1336
          #14 0x56124d066bbe in handle_one_connection /data/src/10.2/sql/sql_connect.cc:1241
          #15 0x56124e3320a8 in pfs_spawn_thread /data/src/10.2/storage/perfschema/pfs.cc:1869
          #16 0x7f0f0f7a2608 in start_thread /build/glibc-ZN95T4/glibc-2.31/nptl/pthread_create.c:477
       
      SUMMARY: AddressSanitizer: 16 byte(s) leaked in 1 allocation(s).
      

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.