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

Element_type &Bounds_checked_array<Item *>::operator[](size_t) [Element_type = Item *]: Assertion `n < m_size' failed.

    XMLWordPrintable

Details

    Description

      OOB assertion failed in debug version of MariaDB.

      POC:

      CREATE TABLE v0 ( v1 INT ) ;
      INSERT INTO v0 ( v1 ) VALUES ( 2 ) ;
      UPDATE v0 SET v1 = 68 WHERE v1 = -128 ;
      INSERT INTO v0 ( v1 ) VALUES ( -32768 ) , ( -128 ) ;
      CREATE VIEW v3 ( v4 , v5 ) AS SELECT * FROM v0 , v0 WINDOW v2 AS ( PARTITION BY 24 , -1 , 18 , 0 ORDER BY v1 DESC ) ;
      

      Stack dump:

      mysqld: /home/mysql/mariadb/sql/sql_array.h:65: Element_type &Bounds_checked_array<Item *>::operator[](size_t) [Element_type = Item *]: Assertion `n < m_size' failed.
      200505  5:03:49 [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.5.3-MariaDB-debug
      key_buffer_size=134217728
      read_buffer_size=131072
      max_used_connections=2
      max_threads=153
      thread_count=3
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467925 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
       
      Thread pointer: 0x7f67ac000d78
      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 = 0x7f67ec95cdc0 thread_stack 0x49000
      fil/fil0fil.cc:3410(fil_ibd_discover(unsigned long, Datafile&))[0x32d4681]
      sql/multi_range_read.cc:764(Mrr_ordered_index_reader::refill_buffer(bool))[0x13c0898]
      ??:0(__restore_rt)[0x7f6806fab890]
      linux/raise.c:51(__GI_raise)[0x7f6804c5de97]
      stdlib/abort.c:81(__GI_abort)[0x7f6804c5f801]
      assert/assert.c:89(__assert_fail_base)[0x7f6804c4f39a]
      ??:0(__assert_fail)[0x7f6804c4f412]
      sql/slave.cc:4601(check_io_slave_killed(Master_info*, char const*))[0xaf8057]
      sql/sql_array.h:272(Dynamic_array<GRANT_NAME*>::~Dynamic_array())[0xbeac1b]
      sql/sql_table.cc:7799(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x112093c]
      sql/slave.cc:3914(sql_delay_event(Log_event*, THD*, rpl_group_info*))[0xaf0938]
      sql/sql_lex.cc:2821(Lex_input_stream::scan_ident_delimited(THD*, Lex_ident_cli_st*, unsigned char))[0xd6ee36]
      sql/sql_lex.cc:910(Lex_input_stream::body_utf8_append(char const*, char const*))[0xd5cc9d]
      sql/sql_lex.cc:7823(LEX::create_item_ident_nospvar(THD*, Lex_ident_sys_st const*, Lex_ident_sys_st const*))[0xda15d4]
      7.5.0/iostream:74(__cxx_global_var_init.13)[0xa1e9eb]
      sql/sys_vars.ic:627(Sys_var_charptr_fscs::Sys_var_charptr(char const*, char const, int, long, unsigned long, CMD_LINE, char const, PolyLock*, sys_var::binlog_status_enum, bool (*)(PolyLock**, THD*, set_var*), bool (*)(sys_var::binlog_status_enum, THD, enum_var_type), char const))[0xa07b70]
      sql/set_var.h:258(_GLOBAL__sub_I_sys_vars.cc)[0x9fd70e]
      sql/sys_vars.cc:5730(__cxx_global_var_init.1236)[0xa099cb]
      sql/item.h:4563(Item_empty_string::Item_empty_string(THD*, char const*, unsigned int, charset_info_st const*))[0xedb6d1]
      sql/item.h:746(show_binlog_info_get_fields(THD*, List<Item>*))[0xedaec1]
      gcalc_slicescan.cc:0(__afl_fork_wait_loop)[0x1e8dfc6]
      nptl/pthread_create.c:463(start_thread)[0x7f6806fa06db]
      x86_64/clone.S:97(clone)[0x7f6804d4088f]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7f67ac0150b3): CREATE VIEW v3 ( v4 , v5 ) AS SELECT * FROM v0 , v0 WINDOW v2 AS ( PARTITION BY 24 , -1 , 18 , 0 ORDER BY v1 DESC )
      Connection ID (thread ID): 12575
      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 http://dev.mysql.com/doc/mysql/en/crashing.html contains
      information that should help you find out what is causing the crash.
      Writing a core file...
      Working directory at /usr/local/mysql/data
      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             unlimited            unlimited            processes
      Max open files            1048576              1048576              files
      Max locked memory         16777216             16777216             bytes
      Max address space         unlimited            unlimited            bytes
      Max file locks            unlimited            unlimited            locks
      Max pending signals       1030951              1030951              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: co...
      ---
      

      Attachments

        Issue Links

          Activity

            People

              varun Varun Gupta (Inactive)
              Ne0 Yongheng Chen
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.