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

Assertion `!templ->mbmaxlen || !(templ->mysql_col_len % templ->mbmaxlen)' failed

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      Assertion found while testing MDEV-37949

      origin/MDEV-37949 c9cede6c5d5805ead99b06f20abf56d004f779f5

      # 2026-03-03T23:26:50 [3888044] | mariadbd: /data/Server/MDEV-37949C/storage/innobase/row/row0sel.cc:2910: void row_sel_field_store_in_mysql_format_func(byte*, const mysql_row_templ_t*, const dict_index_t*, ulint, const byte*, ulint): Assertion `!templ->mbmaxlen || !(templ->mysql_col_len % templ->mbmaxlen)' failed.
      

      Stacktrace and RR trace info

      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
      #3  0x00007c1844edb26e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      #4  0x00007c1844ebe8ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x00007c1844ebe81b in __assert_fail_base (fmt=0x7c18450661e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x6436463d91c0 "!templ->mbmaxlen || !(templ->mysql_col_len % templ->mbmaxlen)", 
          file=file@entry=0x6436463d89c8 "/data/Server/MDEV-37949C/storage/innobase/row/row0sel.cc", line=line@entry=2910, 
          function=function@entry=0x6436463d9068 "void row_sel_field_store_in_mysql_format_func(byte*, const mysql_row_templ_t*, const dict_index_t*, ulint, const byte*, ulint)") at ./assert/assert.c:94
      #6  0x00007c1844ed1507 in __assert_fail (assertion=0x6436463d91c0 "!templ->mbmaxlen || !(templ->mysql_col_len % templ->mbmaxlen)", file=0x6436463d89c8 "/data/Server/MDEV-37949C/storage/innobase/row/row0sel.cc", line=2910, 
          function=0x6436463d9068 "void row_sel_field_store_in_mysql_format_func(byte*, const mysql_row_templ_t*, const dict_index_t*, ulint, const byte*, ulint)") at ./assert/assert.c:103
      #7  0x000064364602a2df in row_sel_field_store_in_mysql_format_func (dest=0x7c185413f309 "1111111111          ", templ=templ@entry=0x7c18540754b0, index=index@entry=0x7c1854143910, field_no=field_no@entry=5, 
          data=data@entry=0x745803bc609c "1111111111          ", '1' <repeats 180 times>..., len=20) at /data/Server/MDEV-37949C/storage/innobase/row/row0sel.cc:2910
      #8  0x000064364602b66a in row_sel_store_mysql_field (mysql_rec=mysql_rec@entry=0x7c185413f300 "\374h", prebuilt=prebuilt@entry=0x7c1854147f40, rec=rec@entry=0x745803bc6081 "", index=index@entry=0x7c1854143910, 
          offsets=offsets@entry=0x6fffa2d0, field_no=5, templ=0x7c18540754b0) at /data/Server/MDEV-37949C/storage/innobase/row/row0sel.cc:3103
      #9  0x000064364602bdd0 in row_sel_store_mysql_rec (mysql_rec=mysql_rec@entry=0x7c185413f300 "\374h", prebuilt=prebuilt@entry=0x7c1854147f40, rec=0x745803bc6081 "", vrow=0x0, rec_clust=false, index=0x7c1854143910, offsets=0x6fffa2d0)
          at /data/Server/MDEV-37949C/storage/innobase/row/row0sel.cc:3239
      #10 0x0000643646033d45 in row_search_mvcc (buf=buf@entry=0x7c185413f300 "\374h", mode=<optimized out>, prebuilt=0x7c1854147f40, match_mode=<optimized out>, direction=direction@entry=0)
          at /data/Server/MDEV-37949C/storage/innobase/row/row0sel.cc:5710
      #11 0x0000643645ec19e4 in ha_innobase::index_read (this=this@entry=0x7c185413eae8, buf=0x7c185413f300 "\374h", key_ptr=key_ptr@entry=0x0, key_len=key_len@entry=0, find_flag=find_flag@entry=HA_READ_AFTER_KEY)
          at /data/Server/MDEV-37949C/storage/innobase/handler/ha_innodb.cc:9024
      #12 0x0000643645ec1d49 in ha_innobase::index_first (this=this@entry=0x7c185413eae8, buf=<optimized out>) at /data/Server/MDEV-37949C/storage/innobase/handler/ha_innodb.cc:9372
      #13 0x0000643645ec1d70 in ha_innobase::rnd_next (this=0x7c185413eae8, buf=<optimized out>) at /data/Server/MDEV-37949C/storage/innobase/handler/ha_innodb.cc:9476
      #14 0x0000643645c8c71d in handler::ha_rnd_next (this=this@entry=0x7c185413eae8, buf=0x7c185413f300 "\374h") at /data/Server/MDEV-37949C/sql/handler.cc:3781
      #15 0x0000643645c8cc66 in handler::calculate_checksum (this=0x7c185413eae8) at /data/Server/MDEV-37949C/sql/handler.cc:6231
      #16 0x0000643645ab2593 in mysql_checksum_table (thd=thd@entry=0x7c1854000d58, tables=tables@entry=0x7c1854015cf0, check_opt=check_opt@entry=0x7c1854006358) at /data/Server/MDEV-37949C/sql/sql_table.cc:13098
      #17 0x00006436459fb267 in mysql_execute_command (thd=thd@entry=0x7c1854000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/Server/MDEV-37949C/sql/sql_parse.cc:4450
      #18 0x00006436459ffdaf in mysql_parse (thd=thd@entry=0x7c1854000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x6fffb400) at /data/Server/MDEV-37949C/sql/sql_parse.cc:7945
      #19 0x0000643645a01492 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7c1854000d58, packet=packet@entry=0x7c185400b109 "", packet_length=packet_length@entry=88, blocking=blocking@entry=true)
          at /data/Server/MDEV-37949C/sql/sql_parse.cc:1925
      #20 0x0000643645a029df in do_command (thd=thd@entry=0x7c1854000d58, blocking=blocking@entry=true) at /data/Server/MDEV-37949C/sql/sql_parse.cc:1433
      #21 0x0000643645b2e329 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x78c95b92c088, put_in_cache=put_in_cache@entry=true) at /data/Server/MDEV-37949C/sql/sql_connect.cc:1497
      #22 0x0000643645b2e53a in handle_one_connection (arg=0x78c95b92c088) at /data/Server/MDEV-37949C/sql/sql_connect.cc:1409
      #23 0x00007c1844f32a94 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
      #24 0x00007c1844fbfa34 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100
      (rr) frame 7
      #7  0x000064364602a2df in row_sel_field_store_in_mysql_format_func (dest=0x7c185413f309 "1111111111          ", templ=templ@entry=0x7c18540754b0, index=index@entry=0x7c1854143910, field_no=field_no@entry=5, 
          data=data@entry=0x745803bc609c "1111111111          ", '1' <repeats 180 times>..., len=20) at /data/Server/MDEV-37949C/storage/innobase/row/row0sel.cc:2910
      2910                    ut_ad(!templ->mbmaxlen
      (rr) p *templ
      $1 = {col_no = 2, rec_field_no = 5, rec_field_is_prefix = 0, rec_prefix_field_no = 18446744073709551615, clust_rec_field_no = 5, icp_rec_field_no = 10344644715844964239, mysql_col_offset = 9, mysql_col_len = 502, mysql_null_byte_offset = 0, 
        mysql_null_bit_mask = 4, type = 13, mysql_type = 15, mysql_length_bytes = 2, charset = 1107, mbminlen = 1, mbmaxlen = 3, is_unsigned = 0, is_virtual = 0}
      (rr) p templ->mbmaxlen
      $2 = 3
      (rr) p templ->mysql_col_len
      $3 = 502
      (rr) p templ->mysql_type
      $4 = 15
      (rr)  p templ->mbmaxlen
      $5 = 3
      (rr) p dict_table_get_n_cols(index->table)
      $6 = 10
      (rr) p index->table->name
      $7 = {m_name = 0x7c1854070f90 "test/t3"}
      
      

      RQG startup options

      # $RQG_HOME/rqg.pl \
      # --gendata=conf/mariadb/table_stress.zz \
      # --gendata_sql=conf/mariadb/table_stress.sql \
      # --grammar=conf/mariadb/table_stress_innodb.yy \
      # --redefine=conf/mariadb/redefine_innodb_log_archive.yy \
      # --mysqld=--loose-innodb_log_archive=ON \
      # --mysqld=--loose-innodb_log_file_size=8M \
      # --mysqld=--loose-innodb_log_file_mmap=OFF \
      # --reporters=LogArchiveRecovery \
      # --mysqld=--loose-innodb_lock_schedule_algorithm=fcfs \
      # --mysqld=--loose-idle_write_transaction_timeout=0 \
      # --mysqld=--loose-idle_transaction_timeout=0 \
      # --mysqld=--loose-idle_readonly_transaction_timeout=0 \
      # --mysqld=--connect_timeout=60 \
      # --mysqld=--interactive_timeout=28800 \
      # --mysqld=--slave_net_timeout=60 \
      # --mysqld=--net_read_timeout=30 \
      # --mysqld=--net_write_timeout=60 \
      # --mysqld=--loose-table_lock_wait_timeout=50 \
      # --mysqld=--wait_timeout=28800 \
      # --no_mask \
      # --queries=10000000 \
      # --seed=random \
      # --reporters=None \
      # --reporters=ErrorLog \
      # --reporters=Deadlock \
      # --validators=None \
      # --mysqld=--log_output=none \
      # --mysqld=--log_bin_trust_function_creators=1 \
      # --mysqld=--loose-debug_assert_on_not_freed_memory=0 \
      # --engine=InnoDB \
      # --restart_timeout=240 \
      # --mysqld=--plugin-load-add=file_key_management.so \
      # --mysqld=--loose-file-key-management-filename=$RQG_HOME/conf/mariadb/encryption_keys.txt \
      # --mysqld=--plugin-load-add=provider_lzo.so \
      # --mysqld=--plugin-load-add=provider_bzip2.so \
      # --mysqld=--plugin-load-add=provider_lzma.so \
      # --mysqld=--plugin-load-add=provider_snappy.so \
      # --mysqld=--plugin-load-add=provider_lz4.so \
      # --mysqld=--loose-innodb_compression_level=1 \
      # --duration=300 \
      # --mysqld=--loose-innodb_fatal_semaphore_wait_threshold=300 \
      # --redefine=conf/mariadb/redefine_innodb_log_write_ahead_size.yy \
      # --mysqld=--lock-wait-timeout=15 \
      # --mysqld=--innodb-lock-wait-timeout=10 \
      # --mysqld=--sql_mode=traditional \
      # --mysqld=--innodb_file_per_table=0 \
      # --mysqld=--loose-innodb_read_only_compressed=OFF \
      # --mysqld=--loose-innodb-sync-debug \
      # --mysqld=--innodb_stats_persistent=off \
      # --mysqld=--innodb_adaptive_hash_index=off \
      # --mysqld=--innodb_random_read_ahead=OFF \
      # --mysqld=--log-bin \
      # --mysqld=--sync-binlog=1 \
      # --mysqld=--loose-innodb_evict_tables_on_commit_debug=on \
      # --threads=3 \
      # --rr=Extended \
      # --rr_options=--chaos --wait \
      # --mysqld=--innodb_undo_log_truncate=OFF \
      # --mysqld=--innodb_undo_tablespaces=3 \
      # --mysqld=--innodb_rollback_on_timeout=OFF \
      # --mysqld=--innodb_page_size=4K \
      # --mysqld=--innodb-buffer-pool-size=6M \
      # --vardir_type=fast \
      # --no_mask \
      # --batch \
      # --basedir1=/Server_bin/MDEV-37949C_debug_Og \
      # --basedir2=/Server_bin/MDEV-37949C_debug_Og \
      # --script_debug=_nix_ \
      # --major_runid=1772606456 \
      # --minor_runid=49
      #--------
      # rqg_rr_add="--innodb-use-native-aio=0" "--loose-innodb-write-io-threads=2" "--loose-innodb-read-io-threads=1" "--loose-gdb" "--loose-debug-gdb"
      # vardir=/dev/shm/rqg/1772606456/49 fs_type=tmpfs
      

      RR trace is present on SDP:
      /data/results/1772606456/TBR-2380

      Attachments

        Activity

          People

            thiru Thirunarayanan Balathandayuthapani
            saahil Saahil Alam
            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.