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

MSAN / Valgrind errors in Item_func_like::get_mm_leaf upon query from partitioned table

    XMLWordPrintable

Details

    Description

      --source include/have_partition.inc
       
      CREATE TABLE t (a INT) PARTITION BY HASH(a) PARTITIONS 2;
      INSERT INTO t VALUES (1),(2);
      SELECT * FROM t WHERE a LIKE '1';
       
      # Cleanup
      DROP TABLE t;
      

      10.6 8941bdc4 Valgrind

      ==1877023== Thread 6:
      ==1877023== Conditional jump or move depends on uninitialised value(s)
      ==1877023==    at 0x1013F9C: Item_func_like::get_mm_leaf(RANGE_OPT_PARAM*, Field*, KEY_PART*, Item_func::Functype, Item*) (opt_range.cc:8757)
      ==1877023==    by 0x1013820: Item_bool_func::get_mm_parts(RANGE_OPT_PARAM*, Field*, Item_func::Functype, Item*) (opt_range.cc:8658)
      ==1877023==    by 0x1028A08: Item_func_like::get_func_mm_tree(RANGE_OPT_PARAM*, Field*, Item*) (item_cmpfunc.h:2875)
      ==1877023==    by 0x10125A4: Item_bool_func::get_full_func_mm_tree(RANGE_OPT_PARAM*, Item_field*, Item*) (opt_range.cc:8317)
      ==1877023==    by 0x9E08D1: Item_bool_func::get_full_func_mm_tree_for_args(RANGE_OPT_PARAM*, Item*, Item*) (item_cmpfunc.h:208)
      ==1877023==    by 0xB2C2FA: Item_bool_func2::get_mm_tree(RANGE_OPT_PARAM*, Item**) (item_cmpfunc.h:464)
      ==1877023==    by 0xEB21FD: Item_func_like::get_mm_tree(RANGE_OPT_PARAM*, Item**) (item_cmpfunc.cc:5878)
      ==1877023==    by 0x1006D9F: prune_partitions(THD*, TABLE*, Item*) (opt_range.cc:3987)
      ==1877023==    by 0xAD434F: JOIN::optimize_inner() (sql_select.cc:2403)
      ==1877023==    by 0xAD21D3: JOIN::optimize() (sql_select.cc:1868)
      ==1877023==    by 0xADE2A6: 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:5077)
      ==1877023==    by 0xACC946: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:559)
      ==1877023==    by 0xA8999A: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:6285)
      ==1877023==    by 0xA808D0: mysql_execute_command(THD*, bool) (sql_parse.cc:3961)
      ==1877023==    by 0xA8E997: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:8050)
      ==1877023==    by 0xA7A3E4: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) (sql_parse.cc:1896)
      

      10.6 8941bdc4 MSAN

      ==1877816==WARNING: MemorySanitizer: use-of-uninitialized-value
          #0 0x5649f52a4d8c in Item_func_like::get_mm_leaf(RANGE_OPT_PARAM*, Field*, KEY_PART*, Item_func::Functype, Item*) /data/src/10.6-msan/sql/opt_range.cc:8757:9
          #1 0x5649f52912b6 in Item_bool_func::get_mm_parts(RANGE_OPT_PARAM*, Field*, Item_func::Functype, Item*) /data/src/10.6-msan/sql/opt_range.cc:8658:18
          #2 0x5649f52f9033 in Item_func_like::get_func_mm_tree(RANGE_OPT_PARAM*, Field*, Item*) /data/src/10.6-msan/sql/item_cmpfunc.h:2875:5
          #3 0x5649f529dd1c in Item_bool_func::get_full_func_mm_tree(RANGE_OPT_PARAM*, Item_field*, Item*) /data/src/10.6-msan/sql/opt_range.cc:8317:12
          #4 0x5649f414b9bd in Item_bool_func::get_full_func_mm_tree_for_args(RANGE_OPT_PARAM*, Item*, Item*) /data/src/10.6-msan/sql/item_cmpfunc.h:208:7
          #5 0x5649f4149540 in Item_bool_func2::get_mm_tree(RANGE_OPT_PARAM*, Item**) /data/src/10.6-msan/sql/item_cmpfunc.h:464:22
          #6 0x5649f4d5c671 in Item_func_like::get_mm_tree(RANGE_OPT_PARAM*, Item**) /data/src/10.6-msan/sql/item_cmpfunc.cc:5878:22
          #7 0x5649f528199b in prune_partitions(THD*, TABLE*, Item*) /data/src/10.6-msan/sql/opt_range.cc:3987:22
          #8 0x5649f3ffa1ae in JOIN::optimize_inner() /data/src/10.6-msan/sql/sql_select.cc:2403:9
          #9 0x5649f3fdf8ec in JOIN::optimize() /data/src/10.6-msan/sql/sql_select.cc:1868:10
          #10 0x5649f3fc05f0 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.6-msan/sql/sql_select.cc:5077:19
          #11 0x5649f3fbf1e6 in handle_select(THD*, LEX*, select_result*, unsigned long) /data/src/10.6-msan/sql/sql_select.cc:559:10
          #12 0x5649f3ef464a in execute_sqlcom_select(THD*, TABLE_LIST*) /data/src/10.6-msan/sql/sql_parse.cc:6285:12
          #13 0x5649f3ece2fe in mysql_execute_command(THD*, bool) /data/src/10.6-msan/sql/sql_parse.cc:3961:12
          #14 0x5649f3eb5d5a in mysql_parse(THD*, char*, unsigned int, Parser_state*) /data/src/10.6-msan/sql/sql_parse.cc:8050:18
          #15 0x5649f3eaa2a0 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /data/src/10.6-msan/sql/sql_parse.cc:1896:7
          #16 0x5649f3eb8150 in do_command(THD*, bool) /data/src/10.6-msan/sql/sql_parse.cc:1409:17
          #17 0x5649f44e7e9f in do_handle_one_connection(CONNECT*, bool) /data/src/10.6-msan/sql/sql_connect.cc:1416:11
          #18 0x5649f44e7485 in handle_one_connection /data/src/10.6-msan/sql/sql_connect.cc:1318:5
          #19 0x5649f595c4ca in pfs_spawn_thread /data/src/10.6-msan/storage/perfschema/pfs.cc:2201:3
          #20 0x7fab4f369fd3 in start_thread nptl/./nptl/pthread_create.c:442:8
          #21 0x7fab4f3ea5bb in clone3 misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
       
        Uninitialized value was created by an allocation of 'prune_param' in the stack frame of function '_Z16prune_partitionsP3THDP5TABLEP4Item'
          #0 0x5649f527fcf0 in prune_partitions(THD*, TABLE*, Item*) /data/src/10.6-msan/sql/opt_range.cc:3930
       
      SUMMARY: MemorySanitizer: use-of-uninitialized-value /data/src/10.6-msan/sql/opt_range.cc:8757:9 in Item_func_like::get_mm_leaf(RANGE_OPT_PARAM*, Field*, KEY_PART*, Item_func::Functype, Item*)
      

      The failure started happening after this commit in 10.6:

      commit 4e9322e2ff25d638013e6e6cf051754084e2f16b
      Author: Monty <monty@mariadb.org>
      Date:   Wed Sep 20 15:46:55 2023 +0300
       
          MDEV-32203 Raise notes when an index cannot be used on data type mismatch
      

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              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.