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

Assertion `0' failed in row_upd_sec_index_entry

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Cannot Reproduce
    • 10.4, 10.5, 10.6, 10.7
    • 10.4.23
    • None
    • Linux version 5.13.0-1-MANJARO (builduser@LEGION) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Mon Jun 7 06:16:10 UTC 2021 x86_64

    Description

      PoC:

      CREATE TABLE v0 ( v1 LONGTEXT DEFAULT ( CONCAT ( 'x' , 'x' ) ) UNIQUE ) AS SELECT floor ( NULL ) AS v2 ;
       UPDATE v0 SET v1 = -1 , v1 = '' ;
       INSERT INTO v0 SET v2 = CONCAT ( 'x' ) ;
       UPDATE IGNORE v0 SET v1 = LPAD ( v1 MOD - v2 , 0 , v2 + 'x' ) WHERE v1 IS NOT NULL ORDER BY v2 LIMIT 8 ;
       DROP TABLE v0 , v0 ;
       START TRANSACTION ;
      

      Log:

      2021-08-16 14:41:38 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
      2021-08-16 14:41:38 0 [Note] InnoDB: Number of pools: 1
      2021-08-16 14:41:38 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
      2021-08-16 14:41:38 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
      2021-08-16 14:41:38 0 [Note] InnoDB: Using liburing
      2021-08-16 14:41:38 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
      2021-08-16 14:41:38 0 [Note] InnoDB: Completed initialization of buffer pool
      2021-08-16 14:41:38 0 [Note] InnoDB: 128 rollback segments are active.
      2021-08-16 14:41:38 0 [Note] InnoDB: Creating shared tablespace for temporary tables
      2021-08-16 14:41:38 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
      2021-08-16 14:41:38 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
      2021-08-16 14:41:38 0 [Note] InnoDB: 10.7.0 started; log sequence number 42161; transaction id 14
      2021-08-16 14:41:38 0 [Note] InnoDB: Loading buffer pool(s) from /home/fuboat/mariadb-tmp/mysql-default-data/ib_buffer_pool
      2021-08-16 14:41:38 0 [Note] Plugin 'FEEDBACK' is disabled.
      2021-08-16 14:41:38 0 [Note] InnoDB: Buffer pool(s) load completed at 210816 14:41:38
      2021-08-16 14:41:38 0 [Note] Server socket created on IP: '0.0.0.0'.
      2021-08-16 14:41:38 0 [Note] Server socket created on IP: '::'.
      2021-08-16 14:41:38 0 [Note] /usr/local/mysql/bin//mysqld: ready for connections.
      Version: '10.7.0-MariaDB'  socket: '/tmp/0.socket'  port: 3306  Source distribution
      2021-08-16 14:41:39 0 [Note] /usr/local/mysql/bin//mysqld (initiated by: root[root] @ localhost []): Normal shutdown
      2021-08-16 14:41:39 0 [Note] InnoDB: FTS optimize thread exiting.
      2021-08-16 14:41:39 0 [Note] InnoDB: Starting shutdown...
      2021-08-16 14:41:39 0 [Note] InnoDB: Dumping buffer pool(s) to /home/fuboat/mariadb-tmp/mysql-default-data/ib_buffer_pool
      2021-08-16 14:41:39 0 [Note] InnoDB: Buffer pool(s) dump completed at 210816 14:41:39
      2021-08-16 14:41:39 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
      2021-08-16 14:41:39 0 [Note] InnoDB: Shutdown completed; log sequence number 42173; transaction id 15
      2021-08-16 14:41:39 0 [Note] /usr/local/mysql/bin//mysqld: Shutdown complete
       
      2021-08-16 15:08:49 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
      2021-08-16 15:08:49 0 [Note] InnoDB: Number of pools: 1
      2021-08-16 15:08:49 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
      2021-08-16 15:08:49 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
      2021-08-16 15:08:49 0 [Note] InnoDB: Using liburing
      2021-08-16 15:08:49 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
      2021-08-16 15:08:49 0 [Note] InnoDB: Completed initialization of buffer pool
      2021-08-16 15:09:10 0 [Note] InnoDB: 128 rollback segments are active.
      2021-08-16 15:09:10 0 [Note] InnoDB: Creating shared tablespace for temporary tables
      2021-08-16 15:09:10 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
      2021-08-16 15:09:10 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
      2021-08-16 15:09:10 0 [Note] InnoDB: 10.7.0 started; log sequence number 42173; transaction id 14
      2021-08-16 15:09:10 0 [Note] InnoDB: Loading buffer pool(s) from /home/fuboat/mariadb-tmp/12/ib_buffer_pool
      2021-08-16 15:09:10 0 [Note] Plugin 'FEEDBACK' is disabled.
      2021-08-16 15:09:10 0 [Note] Server socket created on IP: '0.0.0.0'.
      2021-08-16 15:09:10 0 [Note] Server socket created on IP: '::'.
      2021-08-16 15:09:10 0 [Note] InnoDB: Buffer pool(s) load completed at 210816 15:09:10
      2021-08-16 15:09:10 0 [Note] /usr/local/mysql/bin//mysqld: ready for connections.
      Version: '10.7.0-MariaDB'  socket: '/tmp/12.socket'  port: 10012  Source distribution
      2021-08-16 15:09:12 4 [ERROR] InnoDB: Record in index `v1` of table `test1`.`v0` was not found on update: TUPLE (info_bits=0, 2 fields): {[8]      T (0x00010A0B001E54D3),[6]      (0x000000000200)} at: COMPACT RECORD(info_bits=0, 2 fields): {[8]        (0x0000000100000001),[6]      (0x000000000200)}
      2021-08-16 15:09:12 0x7f139efc4240  InnoDB: Assertion failure in file /experiment/mariadb-server/storage/innobase/row/row0ins.cc line 221
      InnoDB: Failing assertion: !cursor->index->is_committed()
      InnoDB: We intentionally generate a memory trap.
      InnoDB: Submit a detailed bug report to https://jira.mariadb.org/
      InnoDB: If you get repeated assertion failures or crashes, even
      InnoDB: immediately after the mariadbd startup, there may be
      InnoDB: corruption in the InnoDB tablespace. Please refer to
      InnoDB: https://mariadb.com/kb/en/library/innodb-recovery-modes/
      InnoDB: about forcing recovery.
      210816 15:09:12 [ERROR] mysqld got signal 6 ;
      This could be because you hit a bug. It is also possible that this binary
      or one of the libraries it was linked against is corrupt, improperly built,
      or misconfigured. This error can also be caused by malfunctioning hardware.
       
      To report this bug, see https://mariadb.com/kb/en/reporting-bugs
       
      We will try our best to scrape up some info that will hopefully help
      diagnose the problem, but since we have already crashed, 
      something is definitely wrong and this may fail.
       
      Server version: 10.7.0-MariaDB
      key_buffer_size=134217728
      read_buffer_size=131072
      max_used_connections=1
      max_threads=153
      thread_count=1
      It is possible that mysqld could use up to 
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467956 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
       
      Thread pointer: 0x62b0000bd218
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 0x7f139efc3850 thread_stack 0x5fc00
      sanitizer_common/sanitizer_common_interceptors.inc:4203(__interceptor_backtrace.part.0)[0x7f13c51f7c3e]
      mysys/stacktrace.c:213(my_print_stacktrace)[0x55bed103f747]
      sql/signal_handler.cc:222(handle_fatal_signal)[0x55bed0007120]
      sigaction.c:0(__restore_rt)[0x7f13c4be1870]
      :0(__GI_raise)[0x7f13c46c0d22]
      :0(__GI_abort)[0x7f13c46aa862]
      include/ut0ut.h:319(ib::logger& ib::logger::operator<< <int>(int const&))[0x55becf446246]
      row/row0ins.cc:2148(row_ins_sec_index_entry_low(unsigned long, unsigned long, dict_index_t*, mem_block_info_t*, mem_block_info_t*, dtuple_t*, unsigned long, que_thr_t*) [clone .cold])[0x55becf41c82b]
      row/row0ins.cc:3308(row_ins_sec_index_entry(dict_index_t*, dtuple_t*, que_thr_t*, bool))[0x55bed0b11cee]
      row/row0upd.cc:2173(row_upd_sec_index_entry(upd_node_t*, que_thr_t*))[0x55bed0bc71c3]
      row/row0upd.cc:2938(row_upd_step(que_thr_t*))[0x55bed0bc999d]
      row/row0mysql.cc:1742(row_update_for_mysql(row_prebuilt_t*))[0x55bed0b4c7cf]
      handler/ha_innodb.cc:8554(ha_innobase::update_row(unsigned char const*, unsigned char const*))[0x55bed0915e19]
      sql/handler.cc:7567(handler::ha_update_row(unsigned char const*, unsigned char const*))[0x55bed0034606]
      sql/sql_update.cc:1081(mysql_update(THD*, TABLE_LIST*, List<Item>&, List<Item>&, Item*, unsigned int, st_order*, unsigned long long, bool, unsigned long long*, unsigned long long*))[0x55becfb93a88]
      sql/sql_parse.cc:4408(mysql_execute_command(THD*, bool))[0x55becf8a574c]
      sql/sql_parse.cc:8047(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x55becf8ac5a1]
      sql/sql_parse.cc:1898(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x55becf8b260c]
      sql/sql_parse.cc:1406(do_command(THD*, bool))[0x55becf8b773d]
      sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x55becfc72e57]
      sql/sql_connect.cc:1312(handle_one_connection)[0x55becfc7333d]
      perfschema/pfs.cc:2204(pfs_spawn_thread)[0x55bed0703c2c]
      pthread_create.c:0(start_thread)[0x7f13c4bd7259]
      :0(__GI___clone)[0x7f13c47825e3]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x629000087238): UPDATE v0 SET v1 = -1 , v1 = ''
       
      Connection ID (thread ID): 4
      Status: NOT_KILLED
       
      Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off
       
      The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
      information that should help you find out what is causing the crash.
      Writing a core file...
      Working directory at /home/fuboat/mariadb-tmp/12
      Resource Limits:
      Limit                     Soft Limit           Hard Limit           Units     
      Max cpu time              unlimited            unlimited            seconds   
      Max file size             unlimited            unlimited            bytes     
      Max data size             unlimited            unlimited            bytes     
      Max stack size            8388608              unlimited            bytes     
      Max core file size        unlimited            unlimited            bytes     
      Max resident set          unlimited            unlimited            bytes     
      Max processes             61608                61608                processes 
      Max open files            524288               524288               files     
      Max locked memory         65536                65536                bytes     
      Max address space         unlimited            unlimited            bytes     
      Max file locks            unlimited            unlimited            locks     
      Max pending signals       61608                61608                signals   
      Max msgqueue size         819200               819200               bytes     
      Max nice priority         0                    0                    
      Max realtime priority     0                    0                    
      Max realtime timeout      unlimited            unlimited            us        
      Core pattern: core
      
      

      Coredump:

      GNU gdb (GDB) 10.2
      Copyright (C) 2021 Free Software Foundation, Inc.
      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
      Type "show copying" and "show warranty" for details.
      This GDB was configured as "x86_64-pc-linux-gnu".
      Type "show configuration" for configuration details.
      For bug reporting instructions, please see:
      <https://www.gnu.org/software/gdb/bugs/>.
      Find the GDB manual and other documentation resources online at:
          <http://www.gnu.org/software/gdb/documentation/>.
       
      For help, type "help".
      Type "apropos word" to search for commands related to "word"...
      Reading symbols from /usr/local/mysql/bin//mysqld...
      [New LWP 1973719]
      [New LWP 1905319]
      [New LWP 1905285]
      [New LWP 1970461]
      [New LWP 1970159]
      [New LWP 1970462]
      [New LWP 1970464]
      [New LWP 1905279]
      [New LWP 1905291]
      [New LWP 1969293]
      [New LWP 1970162]
      [New LWP 1969294]
      [New LWP 1970165]
      [New LWP 1970472]
      [New LWP 1973362]
      [New LWP 1970176]
      [New LWP 1904949]
      [Thread debugging using libthread_db enabled]
      Using host libthread_db library "/usr/lib/libthread_db.so.1".
      Core was generated by `/usr/local/mysql/bin//mysqld --port 10012 --datadir=/home/fuboat/mariadb-tmp/12'.
      Program terminated with signal SIGABRT, Aborted.
      #0  0x00007f13c4bde808 in pthread_kill () from /usr/lib/libpthread.so.0
      [Current thread is 1 (Thread 0x7f139efc4240 (LWP 1973719))]
      (gdb) (gdb) #0  0x00007f13c4bde808 in pthread_kill () from /usr/lib/libpthread.so.0
      #1  0x000055bed000706b in handle_fatal_signal (sig=<optimized out>) at /experiment/mariadb-server/sql/signal_handler.cc:344
      #2  <signal handler called>
      #3  0x00007f13c46c0d22 in raise () from /usr/lib/libc.so.6
      #4  0x00007f13c46aa862 in abort () from /usr/lib/libc.so.6
      #5  0x000055becf446246 in ut_dbg_assertion_failed (expr=expr@entry=0x55bed150c160 "!cursor->index->is_committed()", file=file@entry=0x55bed150ac80 "/experiment/mariadb-server/storage/innobase/row/row0ins.cc", line=line@entry=221) at /experiment/mariadb-server/storage/innobase/ut/ut0dbg.cc:60
      #6  0x000055becf41c82b in row_ins_sec_index_entry_by_modify (mtr=0x7f139efbef30, thr=0x624000102238, entry=0x6190000ab508, heap=0x6190000abe98, offsets_heap=<optimized out>, offsets=0x7f139efbe550, cursor=0x7f139efbe810, mode=2, flags=0) at /experiment/mariadb-server/storage/innobase/row/row0ins.cc:221
      #7  row_ins_sec_index_entry_low (flags=<optimized out>, mode=2, index=0x616000052f08, offsets_heap=<optimized out>, heap=<optimized out>, entry=<optimized out>, trx_id=<optimized out>, thr=<optimized out>) at /experiment/mariadb-server/storage/innobase/row/row0ins.cc:3091
      #8  0x000055bed0b11cee in row_ins_sec_index_entry (index=index@entry=0x616000052f08, entry=entry@entry=0x6190000ab508, thr=thr@entry=0x624000102238, check_foreign=<optimized out>) at /experiment/mariadb-server/storage/innobase/row/row0ins.cc:3305
      #9  0x000055bed0bc71c3 in row_upd_sec_index_entry (node=<optimized out>, thr=<optimized out>) at /experiment/mariadb-server/storage/innobase/row/row0upd.cc:2173
      #10 0x000055bed0bc999d in row_upd_sec_step (thr=0x624000102238, node=0x620000031be8) at /experiment/mariadb-server/storage/innobase/row/row0upd.cc:2200
      #11 row_upd (thr=0x624000102238, node=0x620000031be8) at /experiment/mariadb-server/storage/innobase/row/row0upd.cc:2936
      #12 row_upd_step (thr=thr@entry=0x624000102238) at /experiment/mariadb-server/storage/innobase/row/row0upd.cc:3051
      #13 0x000055bed0b4c7cf in row_update_for_mysql (prebuilt=<optimized out>) at /experiment/mariadb-server/storage/innobase/row/row0mysql.cc:1740
      #14 0x000055bed0915e19 in ha_innobase::update_row (this=0x61d0000528b8, old_row=<optimized out>, new_row=<optimized out>) at /experiment/mariadb-server/storage/innobase/handler/ha_innodb.cc:8549
      #15 0x000055bed0034606 in handler::ha_update_row (this=0x61d0000528b8, old_data=<optimized out>, new_data=0x6190000a4bc8 <incomplete sequence \372>) at /experiment/mariadb-server/sql/handler.cc:7567
      #16 0x000055becfb93a88 in mysql_update (thd=thd@entry=0x62b0000bd218, table_list=<optimized out>, fields=..., values=..., conds=<optimized out>, order_num=<optimized out>, order=<optimized out>, limit=18446744073709551615, ignore=<optimized out>, found_return=<optimized out>, updated_return=<optimized out>)
          at /experiment/mariadb-server/sql/sql_update.cc:1081
      #17 0x000055becf8a574c in mysql_execute_command (thd=0x62b0000bd218, is_called_from_prepared_stmt=<optimized out>) at /experiment/mariadb-server/sql/sql_parse.cc:4408
      #18 0x000055becf8ac5a1 in mysql_parse (thd=0x62b0000bd218, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /experiment/mariadb-server/sql/sql_parse.cc:8030
      #19 0x000055becf8b260c in dispatch_command (command=<optimized out>, thd=0x62b0000bd218, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /experiment/mariadb-server/sql/sql_parse.cc:1896
      #20 0x000055becf8b773d in do_command (thd=0x62b0000bd218, blocking=blocking@entry=true) at /experiment/mariadb-server/sql/sql_parse.cc:1404
      #21 0x000055becfc72e57 in do_handle_one_connection (connect=<optimized out>, put_in_cache=<optimized out>) at /experiment/mariadb-server/sql/sql_connect.cc:1418
      #22 0x000055becfc7333d in handle_one_connection (arg=arg@entry=0x6080000023b8) at /experiment/mariadb-server/sql/sql_connect.cc:1312
      #23 0x000055bed0703c2c in pfs_spawn_thread (arg=0x617000005b98) at /experiment/mariadb-server/storage/perfschema/pfs.cc:2201
      #24 0x00007f13c4bd7259 in start_thread () from /usr/lib/libpthread.so.0
      #25 0x00007f13c47825e3 in clone () from /usr/lib/libc.so.6
      (gdb) quit
      

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              Zhiyong Zhiyong Wu
              Votes:
              1 Vote for this issue
              Watchers:
              8 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.