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

Valgrind/MSAN errors in cmp_key_rowid_part_id

    XMLWordPrintable

    Details

      Description

      --source include/have_partition.inc
       
      CREATE TABLE t (pk int primary key, f int, key (f)) ENGINE=MyISAM PARTITION BY hash(pk) partitions 2;
      INSERT INTO t VALUES (1,8),(2,8);
      SELECT * FROM t WHERE f IN (8,6);
       
      # Cleanup
      DROP TABLE t;
      

      10.3 86c1bf118

      ==3006655== Conditional jump or move depends on uninitialised value(s)
      ==3006655==    at 0x483EEC5: bcmp (vg_replace_strmem.c:1111)
      ==3006655==    by 0xB4F89A: handler::cmp_ref(unsigned char const*, unsigned char const*) (handler.h:3985)
      ==3006655==    by 0x13AF128: cmp_key_rowid_part_id (ha_partition.cc:5590)
      ==3006655==    by 0x14017EB: _downheap (queues.c:304)
      ==3006655==    by 0x14018BF: queue_fix (queues.c:331)
      ==3006655==    by 0x13B5B4B: ha_partition::handle_ordered_index_scan(unsigned char*, bool) (ha_partition.cc:7734)
      ==3006655==    by 0x13B1C3D: ha_partition::multi_range_read_next(void**) (ha_partition.cc:6520)
      ==3006655==    by 0xCC5E56: QUICK_RANGE_SELECT::get_next() (opt_range.cc:11569)
      ==3006655==    by 0xCD8A22: rr_quick(READ_RECORD*) (records.cc:369)
      ==3006655==    by 0x7661B8: READ_RECORD::read_record() (records.h:70)
      ==3006655==    by 0x887125: join_init_read_record(st_join_table*) (sql_select.cc:20823)
      ==3006655==    by 0x884C47: sub_select(JOIN*, st_join_table*, bool) (sql_select.cc:19878)
      ==3006655==    by 0x8840B4: do_select(JOIN*, Procedure*) (sql_select.cc:19419)
      ==3006655==    by 0x85A9DD: JOIN::exec_inner() (sql_select.cc:4150)
      ==3006655==    by 0x859D9D: JOIN::exec() (sql_select.cc:3944)
      ==3006655==    by 0x85B0CC: mysql_select(THD*, TABLE_LIST*, unsigned int, 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:4353)
      ==3006655== Conditional jump or move depends on uninitialised value(s)
      ==3006655==    at 0x13AF135: cmp_key_rowid_part_id (ha_partition.cc:5590)
      ==3006655==    by 0x14017EB: _downheap (queues.c:304)
      ==3006655==    by 0x14018BF: queue_fix (queues.c:331)
      ==3006655==    by 0x13B5B4B: ha_partition::handle_ordered_index_scan(unsigned char*, bool) (ha_partition.cc:7734)
      ==3006655==    by 0x13B1C3D: ha_partition::multi_range_read_next(void**) (ha_partition.cc:6520)
      ==3006655==    by 0xCC5E56: QUICK_RANGE_SELECT::get_next() (opt_range.cc:11569)
      ==3006655==    by 0xCD8A22: rr_quick(READ_RECORD*) (records.cc:369)
      ==3006655==    by 0x7661B8: READ_RECORD::read_record() (records.h:70)
      ==3006655==    by 0x887125: join_init_read_record(st_join_table*) (sql_select.cc:20823)
      ==3006655==    by 0x884C47: sub_select(JOIN*, st_join_table*, bool) (sql_select.cc:19878)
      ==3006655==    by 0x8840B4: do_select(JOIN*, Procedure*) (sql_select.cc:19419)
      ==3006655==    by 0x85A9DD: JOIN::exec_inner() (sql_select.cc:4150)
      ==3006655==    by 0x859D9D: JOIN::exec() (sql_select.cc:3944)
      ==3006655==    by 0x85B0CC: mysql_select(THD*, TABLE_LIST*, unsigned int, 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:4353)
      ==3006655==    by 0x84C4E8: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:372)
      ==3006655==    by 0x812A35: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:6339)
      

      10.5 2dce3bad9 MSAN

      Uninitialized bytes in MemcmpInterceptorCommon at offset 0 inside [0x706000013965, 7)
      ==32155==WARNING: MemorySanitizer: use-of-uninitialized-value
          #0 0x555a8c4f560e in memcmp (/home/jenkins/10.5/sql/mariadbd+0x71960e)
          #1 0x555a8e3b2c1f in cmp_key_rowid_part_id /home/jenkins/10.5/sql/ha_partition.cc:5761:43
          #2 0x555a8f880d8c in _downheap /home/jenkins/10.5/mysys/queues.c:305:10
          #3 0x555a8f880d8c in queue_fix /home/jenkins/10.5/mysys/queues.c:332:5
          #4 0x555a8e3b8ed5 in ha_partition::handle_ordered_index_scan(unsigned char*, bool) /home/jenkins/10.5/sql/ha_partition.cc:7892:5
          #5 0x555a8e3c87ef in ha_partition::multi_range_read_next(void**) /home/jenkins/10.5/sql/ha_partition.cc:6684:11
          #6 0x555a8dd10a96 in QUICK_RANGE_SELECT::get_next() /home/jenkins/10.5/sql/opt_range.cc:12687:5
          #7 0x555a8dd66a31 in rr_quick(READ_RECORD*) /home/jenkins/10.5/sql/records.cc:403:37
          #8 0x555a8cba11c9 in READ_RECORD::read_record() /home/jenkins/10.5/sql/records.h:80:30
          #9 0x555a8cba11c9 in join_init_read_record(st_join_table*) /home/jenkins/10.5/sql/sql_select.cc:21877:27
          #10 0x555a8cc332fb in sub_select(JOIN*, st_join_table*, bool) /home/jenkins/10.5/sql/sql_select.cc:20910:12
          #11 0x555a8cbab60a in do_select(JOIN*, Procedure*) /home/jenkins/10.5/sql/sql_select.cc:20445:14
          #12 0x555a8cbab60a in JOIN::exec_inner() /home/jenkins/10.5/sql/sql_select.cc:4538:50
          #13 0x555a8cba750c in JOIN::exec() /home/jenkins/10.5/sql/sql_select.cc:4318:3
          #14 0x555a8cb11c93 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*) /home/jenkins/10.5/sql/sql_select.cc:4795:9
          #15 0x555a8cb10a58 in handle_select(THD*, LEX*, select_result*, unsigned long) /home/jenkins/10.5/sql/sql_select.cc:444:10
          #16 0x555a8ca47755 in execute_sqlcom_select(THD*, TABLE_LIST*) /home/jenkins/10.5/sql/sql_parse.cc:6314:12
          #17 0x555a8ca214a8 in mysql_execute_command(THD*) /home/jenkins/10.5/sql/sql_parse.cc:4005:12
          #18 0x555a8ca08938 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /home/jenkins/10.5/sql/sql_parse.cc:8100:18
          #19 0x555a8c9fbbfc in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /home/jenkins/10.5/sql/sql_parse.cc:1891:7
          #20 0x555a8ca0a8ac in do_command(THD*) /home/jenkins/10.5/sql/sql_parse.cc:1370:17
          #21 0x555a8cffe929 in do_handle_one_connection(CONNECT*, bool) /home/jenkins/10.5/sql/sql_connect.cc:1418:11
          #22 0x555a8cffe045 in handle_one_connection /home/jenkins/10.5/sql/sql_connect.cc:1312:5
          #23 0x555a8e3ff86a in pfs_spawn_thread /home/jenkins/10.5/storage/perfschema/pfs.cc:2201:3
          #24 0x7f8b06acf608 in start_thread /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477:8
          #25 0x7f8b067d4292 in clone /build/glibc-eX1tMB/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
       
        Memory was marked as uninitialized
          #0 0x555a8c4f19ae in __msan_allocated_memory (/home/jenkins/10.5/sql/mariadbd+0x7159ae)
          #1 0x555a8f868900 in my_malloc /home/jenkins/10.5/mysys/my_malloc.c:113:7
       
      SUMMARY: MemorySanitizer: use-of-uninitialized-value (/home/jenkins/10.5/sql/mariadbd+0x71960e) in memcmp
      

      Couldn't reproduce on 10.2, but it may be just the matter of a different plan. Same for InnoDB.

        Attachments

          Activity

            People

            Assignee:
            psergei Sergei Petrunia
            Reporter:
            elenst Elena Stepanova
            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.