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

MSAN/Valgrind errors in partition_info::print_no_partition_found upon ER_DATA_OVERFLOW

    XMLWordPrintable

Details

    Description

      --source include/have_partition.inc
       
      CREATE TABLE t (f DECIMAL(50)) PARTITION BY RANGE(f) (PARTITION p0 VALUES LESS THAN (1), PARTITION pn VALUES LESS THAN MAXVALUE);
      --error ER_DATA_OVERFLOW
      INSERT INTO t VALUES (18446744073709551615);
       
      # Cleanup
      DROP TABLE t;
      

      10.5 dd62a285b88958dae9b9f3e49fdd0c55f6eced72 MSAN

      ==2834380==WARNING: MemorySanitizer: use-of-uninitialized-value
          #0 0x561461a4d499 in int10_to_str /data/bld/10.5-msan/strings/int2str.c:152:7
          #1 0x56145ef7152e in partition_info::print_no_partition_found(TABLE*, unsigned long) /data/bld/10.5-msan/sql/partition_info.cc:1415:9
          #2 0x5614603e880a in ha_partition::print_error(int, unsigned long) /data/bld/10.5-msan/sql/ha_partition.cc:10184:18
          #3 0x56145e8d96a7 in write_record(THD*, TABLE*, st_copy_info*, select_result*) /data/bld/10.5-msan/sql/sql_insert.cc:2198:16
          #4 0x56145e8c8ac0 in mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool, select_result*) /data/bld/10.5-msan/sql/sql_insert.cc:1125:14
          #5 0x56145ea183d5 in mysql_execute_command(THD*) /data/bld/10.5-msan/sql/sql_parse.cc:4641:10
          #6 0x56145e9ea647 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/bld/10.5-msan/sql/sql_parse.cc:8121:18
          #7 0x56145e9ddbd2 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/bld/10.5-msan/sql/sql_parse.cc:1891:7
          #8 0x56145e9ec5e8 in do_command(THD*) /data/bld/10.5-msan/sql/sql_parse.cc:1375:17
          #9 0x56145efef34f in do_handle_one_connection(CONNECT*, bool) /data/bld/10.5-msan/sql/sql_connect.cc:1416:11
          #10 0x56145efeea45 in handle_one_connection /data/bld/10.5-msan/sql/sql_connect.cc:1318:5
          #11 0x561460409a5a in pfs_spawn_thread /data/bld/10.5-msan/storage/perfschema/pfs.cc:2201:3
          #12 0x7fcb42f4a043 in start_thread nptl/./nptl/pthread_create.c:442:8
          #13 0x7fcb42fca61b in clone3 misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
       
        Uninitialized value was stored to memory at
          #0 0x5614603aef58 in ha_partition::write_row(unsigned char const*) /data/bld/10.5-msan/sql/ha_partition.cc:4545:27
       
        Uninitialized value was created by an allocation of 'func_value' in the stack frame of function '_ZN12ha_partition9write_rowEPKh'
          #0 0x5614603addb0 in ha_partition::write_row(unsigned char const*) /data/bld/10.5-msan/sql/ha_partition.cc:4494
       
      SUMMARY: MemorySanitizer: use-of-uninitialized-value /data/bld/10.5-msan/strings/int2str.c:152:7 in int10_to_str
      

      10.4 64f44b22d9a3dab3d4c0b77addbcbdafde57b466 Valgrind

      ==2834605== Thread 6:
      ==2834605== Conditional jump or move depends on uninitialised value(s)
      ==2834605==    at 0x16F0875: int10_to_str (int2str.c:154)
      ==2834605==    by 0xB10A99: partition_info::print_no_partition_found(TABLE*, unsigned long) (partition_info.cc:1475)
      ==2834605==    by 0x105A8C4: ha_partition::print_error(int, unsigned long) (ha_partition.cc:10054)
      ==2834605==    by 0x94686C: write_record(THD*, TABLE*, st_copy_info*) (sql_insert.cc:2123)
      ==2834605==    by 0x943356: mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:1087)
      ==2834605==    by 0x995665: mysql_execute_command(THD*) (sql_parse.cc:4615)
      ==2834605==    by 0x9A13A8: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:8060)
      ==2834605==    by 0x98CB1F: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:1857)
      ==2834605==    by 0x98B386: do_command(THD*) (sql_parse.cc:1378)
      ==2834605==    by 0xB3595E: do_handle_one_connection(CONNECT*) (sql_connect.cc:1419)
      ==2834605==    by 0xB356C6: handle_one_connection (sql_connect.cc:1323)
      ==2834605==    by 0x10AB27F: pfs_spawn_thread (pfs.cc:1869)
      ==2834605==    by 0x4D7E043: start_thread (pthread_create.c:442)
      ==2834605==    by 0x4DFD87F: clone (clone.S:100)
      ==2834605== Conditional jump or move depends on uninitialised value(s)
      ==2834605==    at 0x16F0939: int10_to_str (int2str.c:168)
      ==2834605==    by 0xB10A99: partition_info::print_no_partition_found(TABLE*, unsigned long) (partition_info.cc:1475)
      ==2834605==    by 0x105A8C4: ha_partition::print_error(int, unsigned long) (ha_partition.cc:10054)
      ==2834605==    by 0x94686C: write_record(THD*, TABLE*, st_copy_info*) (sql_insert.cc:2123)
      ==2834605==    by 0x943356: mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:1087)
      ==2834605==    by 0x995665: mysql_execute_command(THD*) (sql_parse.cc:4615)
      ==2834605==    by 0x9A13A8: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:8060)
      ==2834605==    by 0x98CB1F: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:1857)
      ==2834605==    by 0x98B386: do_command(THD*) (sql_parse.cc:1378)
      ==2834605==    by 0xB3595E: do_handle_one_connection(CONNECT*) (sql_connect.cc:1419)
      ==2834605==    by 0xB356C6: handle_one_connection (sql_connect.cc:1323)
      ==2834605==    by 0x10AB27F: pfs_spawn_thread (pfs.cc:1869)
      ==2834605==    by 0x4D7E043: start_thread (pthread_create.c:442)
      ==2834605==    by 0x4DFD87F: clone (clone.S:100)
      ==2834605== Conditional jump or move depends on uninitialised value(s)
      ==2834605==    at 0x16F0959: int10_to_str (int2str.c:174)
      ==2834605==    by 0xB10A99: partition_info::print_no_partition_found(TABLE*, unsigned long) (partition_info.cc:1475)
      ==2834605==    by 0x105A8C4: ha_partition::print_error(int, unsigned long) (ha_partition.cc:10054)
      ==2834605==    by 0x94686C: write_record(THD*, TABLE*, st_copy_info*) (sql_insert.cc:2123)
      ==2834605==    by 0x943356: mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:1087)
      ==2834605==    by 0x995665: mysql_execute_command(THD*) (sql_parse.cc:4615)
      ==2834605==    by 0x9A13A8: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:8060)
      ==2834605==    by 0x98CB1F: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:1857)
      ==2834605==    by 0x98B386: do_command(THD*) (sql_parse.cc:1378)
      ==2834605==    by 0xB3595E: do_handle_one_connection(CONNECT*) (sql_connect.cc:1419)
      ==2834605==    by 0xB356C6: handle_one_connection (sql_connect.cc:1323)
      ==2834605==    by 0x10AB27F: pfs_spawn_thread (pfs.cc:1869)
      ==2834605==    by 0x4D7E043: start_thread (pthread_create.c:442)
      ==2834605==    by 0x4DFD87F: clone (clone.S:100)
      ==2834605== Conditional jump or move depends on uninitialised value(s)
      ==2834605==    at 0x484673D: strnlen (vg_replace_strmem.c:461)
      ==2834605==    by 0x16F19DF: process_str_arg (my_vsnprintf.c:259)
      ==2834605==    by 0x16F366B: my_vsnprintf_ex (my_vsnprintf.c:696)
      ==2834605==    by 0x1668223: my_error (my_error.c:121)
      ==2834605==    by 0xB10AD9: partition_info::print_no_partition_found(TABLE*, unsigned long) (partition_info.cc:1479)
      ==2834605==    by 0x105A8C4: ha_partition::print_error(int, unsigned long) (ha_partition.cc:10054)
      ==2834605==    by 0x94686C: write_record(THD*, TABLE*, st_copy_info*) (sql_insert.cc:2123)
      ==2834605==    by 0x943356: mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:1087)
      ==2834605==    by 0x995665: mysql_execute_command(THD*) (sql_parse.cc:4615)
      ==2834605==    by 0x9A13A8: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:8060)
      ==2834605==    by 0x98CB1F: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:1857)
      ==2834605==    by 0x98B386: do_command(THD*) (sql_parse.cc:1378)
      ==2834605==    by 0xB3595E: do_handle_one_connection(CONNECT*) (sql_connect.cc:1419)
      ==2834605==    by 0xB356C6: handle_one_connection (sql_connect.cc:1323)
      ==2834605==    by 0x10AB27F: pfs_spawn_thread (pfs.cc:1869)
      ==2834605==    by 0x4D7E043: start_thread (pthread_create.c:442)
      ==2834605== Conditional jump or move depends on uninitialised value(s)
      ==2834605==    at 0x16DBB3D: my_charlen_utf8 (ctype-utf8.c:5204)
      ==2834605==    by 0x16DBB97: my_well_formed_char_length_utf8 (ctype-mb.inl:187)
      ==2834605==    by 0x16F129D: my_well_formed_length (m_ctype.h:1165)
      ==2834605==    by 0x16F1A35: process_str_arg (my_vsnprintf.c:265)
      ==2834605==    by 0x16F366B: my_vsnprintf_ex (my_vsnprintf.c:696)
      ==2834605==    by 0x1668223: my_error (my_error.c:121)
      ==2834605==    by 0xB10AD9: partition_info::print_no_partition_found(TABLE*, unsigned long) (partition_info.cc:1479)
      ==2834605==    by 0x105A8C4: ha_partition::print_error(int, unsigned long) (ha_partition.cc:10054)
      ==2834605==    by 0x94686C: write_record(THD*, TABLE*, st_copy_info*) (sql_insert.cc:2123)
      ==2834605==    by 0x943356: mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:1087)
      ==2834605==    by 0x995665: mysql_execute_command(THD*) (sql_parse.cc:4615)
      ==2834605==    by 0x9A13A8: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:8060)
      ==2834605==    by 0x98CB1F: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:1857)
      ==2834605==    by 0x98B386: do_command(THD*) (sql_parse.cc:1378)
      ==2834605==    by 0xB3595E: do_handle_one_connection(CONNECT*) (sql_connect.cc:1419)
      ==2834605==    by 0xB356C6: handle_one_connection (sql_connect.cc:1323)
      ==2834605== Conditional jump or move depends on uninitialised value(s)
      ==2834605==    at 0x16DA365: my_valid_mbcharlen_utf8mb3 (ctype-utf8.c:82)
      ==2834605==    by 0x16DBB51: my_charlen_utf8 (ctype-utf8.c:5205)
      ==2834605==    by 0x16DBB97: my_well_formed_char_length_utf8 (ctype-mb.inl:187)
      ==2834605==    by 0x16F129D: my_well_formed_length (m_ctype.h:1165)
      ==2834605==    by 0x16F1A35: process_str_arg (my_vsnprintf.c:265)
      ==2834605==    by 0x16F366B: my_vsnprintf_ex (my_vsnprintf.c:696)
      ==2834605==    by 0x1668223: my_error (my_error.c:121)
      ==2834605==    by 0xB10AD9: partition_info::print_no_partition_found(TABLE*, unsigned long) (partition_info.cc:1479)
      ==2834605==    by 0x105A8C4: ha_partition::print_error(int, unsigned long) (ha_partition.cc:10054)
      ==2834605==    by 0x94686C: write_record(THD*, TABLE*, st_copy_info*) (sql_insert.cc:2123)
      ==2834605==    by 0x943356: mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:1087)
      ==2834605==    by 0x995665: mysql_execute_command(THD*) (sql_parse.cc:4615)
      ==2834605==    by 0x9A13A8: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:8060)
      ==2834605==    by 0x98CB1F: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:1857)
      ==2834605==    by 0x98B386: do_command(THD*) (sql_parse.cc:1378)
      ==2834605==    by 0xB3595E: do_handle_one_connection(CONNECT*) (sql_connect.cc:1419)
      ==2834605== Conditional jump or move depends on uninitialised value(s)
      ==2834605==    at 0x16F47D3: strnmov (strnmov.c:41)
      ==2834605==    by 0x16F1AA3: process_str_arg (my_vsnprintf.c:272)
      ==2834605==    by 0x16F366B: my_vsnprintf_ex (my_vsnprintf.c:696)
      ==2834605==    by 0x1668223: my_error (my_error.c:121)
      ==2834605==    by 0xB10AD9: partition_info::print_no_partition_found(TABLE*, unsigned long) (partition_info.cc:1479)
      ==2834605==    by 0x105A8C4: ha_partition::print_error(int, unsigned long) (ha_partition.cc:10054)
      ==2834605==    by 0x94686C: write_record(THD*, TABLE*, st_copy_info*) (sql_insert.cc:2123)
      ==2834605==    by 0x943356: mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:1087)
      ==2834605==    by 0x995665: mysql_execute_command(THD*) (sql_parse.cc:4615)
      ==2834605==    by 0x9A13A8: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:8060)
      ==2834605==    by 0x98CB1F: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:1857)
      ==2834605==    by 0x98B386: do_command(THD*) (sql_parse.cc:1378)
      ==2834605==    by 0xB3595E: do_handle_one_connection(CONNECT*) (sql_connect.cc:1419)
      ==2834605==    by 0xB356C6: handle_one_connection (sql_connect.cc:1323)
      ==2834605==    by 0x10AB27F: pfs_spawn_thread (pfs.cc:1869)
      ==2834605==    by 0x4D7E043: start_thread (pthread_create.c:442)
      ==2834605== Conditional jump or move depends on uninitialised value(s)
      ==2834605==    at 0x4846798: strlen (vg_replace_strmem.c:494)
      ==2834605==    by 0x16630BB: strdup_root (my_alloc.c:481)
      ==2834605==    by 0x938BC8: Sql_condition::set_builtin_message_text(char const*) (sql_error.cc:219)
      ==2834605==    by 0x8A933A: Sql_condition::Sql_condition(st_mem_root*, Sql_condition_identity const&, char const*) (sql_error.h:445)
      ==2834605==    by 0x93A3B9: Warning_info::push_warning(THD*, Sql_condition_identity const*, char const*) (sql_error.cc:676)
      ==2834605==    by 0x925FBF: Diagnostics_area::push_warning(THD*, unsigned int, char const*, Sql_state_errno_level::enum_warning_level, Sql_user_condition_identity const&, char const*) (sql_error.h:1195)
      ==2834605==    by 0x9115FD: THD::raise_condition(unsigned int, char const*, Sql_state_errno_level::enum_warning_level, Sql_user_condition_identity const&, char const*) (sql_class.cc:1104)
      ==2834605==    by 0x849B03: THD::raise_condition(unsigned int, char const*, Sql_state_errno_level::enum_warning_level, char const*) (sql_class.h:4522)
      ==2834605==    by 0x83C5EB: my_message_sql (mysqld.cc:3389)
      ==2834605==    by 0x1668249: my_error (my_error.c:125)
      ==2834605==    by 0xB10AD9: partition_info::print_no_partition_found(TABLE*, unsigned long) (partition_info.cc:1479)
      ==2834605==    by 0x105A8C4: ha_partition::print_error(int, unsigned long) (ha_partition.cc:10054)
      ==2834605==    by 0x94686C: write_record(THD*, TABLE*, st_copy_info*) (sql_insert.cc:2123)
      ==2834605==    by 0x943356: mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:1087)
      ==2834605==    by 0x995665: mysql_execute_command(THD*) (sql_parse.cc:4615)
      ==2834605==    by 0x9A13A8: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:8060)
      ==2834605== Conditional jump or move depends on uninitialised value(s)
      ==2834605==    at 0x4846798: strlen (vg_replace_strmem.c:494)
      ==2834605==    by 0x938BED: Sql_condition::set_builtin_message_text(char const*) (sql_error.cc:220)
      ==2834605==    by 0x8A933A: Sql_condition::Sql_condition(st_mem_root*, Sql_condition_identity const&, char const*) (sql_error.h:445)
      ==2834605==    by 0x93A3B9: Warning_info::push_warning(THD*, Sql_condition_identity const*, char const*) (sql_error.cc:676)
      ==2834605==    by 0x925FBF: Diagnostics_area::push_warning(THD*, unsigned int, char const*, Sql_state_errno_level::enum_warning_level, Sql_user_condition_identity const&, char const*) (sql_error.h:1195)
      ==2834605==    by 0x9115FD: THD::raise_condition(unsigned int, char const*, Sql_state_errno_level::enum_warning_level, Sql_user_condition_identity const&, char const*) (sql_class.cc:1104)
      ==2834605==    by 0x849B03: THD::raise_condition(unsigned int, char const*, Sql_state_errno_level::enum_warning_level, char const*) (sql_class.h:4522)
      ==2834605==    by 0x83C5EB: my_message_sql (mysqld.cc:3389)
      ==2834605==    by 0x1668249: my_error (my_error.c:125)
      ==2834605==    by 0xB10AD9: partition_info::print_no_partition_found(TABLE*, unsigned long) (partition_info.cc:1479)
      ==2834605==    by 0x105A8C4: ha_partition::print_error(int, unsigned long) (ha_partition.cc:10054)
      ==2834605==    by 0x94686C: write_record(THD*, TABLE*, st_copy_info*) (sql_insert.cc:2123)
      ==2834605==    by 0x943356: mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:1087)
      ==2834605==    by 0x995665: mysql_execute_command(THD*) (sql_parse.cc:4615)
      ==2834605==    by 0x9A13A8: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:8060)
      ==2834605==    by 0x98CB1F: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:1857)
      

      The SQL error is 1916 ER_DATA_OVERFLOW

      ERROR 22003: Got overflow when converting '18446744073709551615' to INT. Value truncated
      

      Attachments

        Activity

          People

            holyfoot Alexey Botchkov
            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.