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

UBSAN: load of value 190, which is not a valid value for type 'bool' in storage/spider/ha_spider.cc|ha_spider::sync_from_clone_source_base

    XMLWordPrintable

Details

    Description

      INSTALL PLUGIN Spider SONAME 'ha_spider.so';
      CREATE TABLE t (c DATE KEY,c2 CHAR(1) BINARY CHARACTER SET 'latin1' COLLATE 'latin1_bin',c3 CHAR(1) BINARY,c4 VARCHAR(1025) BINARY CHARACTER SET 'utf8' COLLATE 'utf8_bin') ENGINE=Spider ROW_FORMAT=REDUNDANT;
      ALTER TABLE t ADD UNIQUE (c2,c4,c3);
      UPDATE t SET c='123';
      

      Leads to:

      11.5.0 3f9182126c64bcec359bebe9ebad2a0e559b13e2 (Optimized, UBASAN)

      /test/11.5_opt_san/storage/spider/ha_spider.cc:10029:46: runtime error: load of value 190, which is not a valid value for type 'bool'
          #0 0x14fb529c0f0a in ha_spider::sync_from_clone_source_base(ha_spider*) /test/11.5_opt_san/storage/spider/ha_spider.cc:10029
          #1 0x14fb52c560f3 in ha_spider::clone(char const*, st_mem_root*) /test/11.5_opt_san/storage/spider/ha_spider.cc:207
          #2 0x55c40cd7fe30 in handler::create_lookup_handler() /test/11.5_opt_san/sql/handler.cc:3315
          #3 0x55c40cd8b3ae in handler::prepare_for_insert(bool) /test/11.5_opt_san/sql/handler.cc:7857
          #4 0x55c40be31049 in multi_update::prepare(List<Item>&, st_select_lex_unit*) /test/11.5_opt_san/sql/sql_update.cc:1819
          #5 0x55c40ba0cb90 in JOIN::prepare(TABLE_LIST*, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*) /test/11.5_opt_san/sql/sql_select.cc:1834
          #6 0x55c40be74cca in Sql_cmd_update::prepare_inner(THD*) /test/11.5_opt_san/sql/sql_update.cc:3014
          #7 0x55c40b842cdf in Sql_cmd_dml::prepare(THD*) /test/11.5_opt_san/sql/sql_select.cc:33497
          #8 0x55c40b848ae9 in Sql_cmd_dml::execute(THD*) /test/11.5_opt_san/sql/sql_select.cc:33550
          #9 0x55c40b6b6170 in mysql_execute_command(THD*, bool) /test/11.5_opt_san/sql/sql_parse.cc:4391
          #10 0x55c40b6d5aed in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/11.5_opt_san/sql/sql_parse.cc:7815
          #11 0x55c40b6e3519 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/11.5_opt_san/sql/sql_parse.cc:1892
          #12 0x55c40b6edce3 in do_command(THD*, bool) /test/11.5_opt_san/sql/sql_parse.cc:1405
          #13 0x55c40c07f887 in do_handle_one_connection(CONNECT*, bool) /test/11.5_opt_san/sql/sql_connect.cc:1445
          #14 0x55c40c08227c in handle_one_connection /test/11.5_opt_san/sql/sql_connect.cc:1347
          #15 0x14fb7568f189 in start_thread nptl/pthread_create.c:444
          #16 0x14fb7571dbcf in clone3 ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Setup:

      Compiled with a recent version of GCC (I use GCC 12.3.0) and:
          -DWITH_UBSAN=ON
      Set before execution:
          export UBSAN_OPTIONS=print_stacktrace=1
      

      Bug confirmed present in:
      MariaDB: 11.1.5 (dbg), 11.1.5 (opt), 11.2.4 (dbg), 11.2.4 (opt), 11.3.3 (dbg), 11.3.3 (opt), 11.4.2 (dbg), 11.4.2 (opt), 11.5.0 (dbg), 11.5.0 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.5.25 (dbg), 10.5.25 (opt), 10.6.18 (dbg), 10.6.18 (opt), 10.11.8 (dbg), 10.11.8 (opt)

      Attachments

        Activity

          People

            holyfoot Alexey Botchkov
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.