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

MariaDB Server SEGV issue

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.7.0
    • N/A
    • N/A
    • 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

      step to reproduce:

      CREATE TABLE v0 ( v3 DATETIME , v2 INT , v1 DATETIME ) ;
       DELETE FROM v0 WHERE v3 IN ( SELECT v2 FROM v0 GROUP BY ( SELECT v3 ) ) ;
       DROP TABLE v0 , v0 , v0 , v0 , v0 , v0 , v0 , v0 , v0 , v0 , v0 , v0 , v0 , v0 , v0 , ENGINE ;
       DROP PROCEDURE v0 ;
       CREATE VIEW v4 AS SELECT * FROM v0 WHERE v1 NOT IN ( -128 ) ;
       ALTER TABLE v4 ADD INDEX ( CODE ) ;
      

      report (compiled with ASAN):

      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 = 0x7f3f592a1850 thread_stack 0x5fc00
      sanitizer_common/sanitizer_common_interceptors.inc:4203(__interceptor_backtrace.part.0)[0x7f3f7ecd4c3e]
      mysys/stacktrace.c:213(my_print_stacktrace)[0x558a9b591747]
      sql/signal_handler.cc:222(handle_fatal_signal)[0x558a9a559120]
      sigaction.c:0(__restore_rt)[0x7f3f7e6be870]
      sql/item_subselect.cc:7020(Item_subselect::init_expr_cache_tracker(THD*))[0x558a9a865b99]
      sql/item_subselect.cc:1405(Item_singlerow_subselect::expr_cache_insert_transformer(THD*, unsigned char*))[0x558a9a865cf9]
      sql/item.cc:607(Item::transform(THD*, Item* (Item::*)(THD*, unsigned char*), unsigned char*))[0x558a9a595ef1]
      sql/sql_select.cc:4235(JOIN::setup_subquery_caches())[0x558a99ed6da3]
      sql/sql_select.cc:3065(JOIN::optimize_stage2())[0x558a99f7e8df]
      sql/sql_select.cc:2479(JOIN::optimize_inner())[0x558a99f88d07]
      sql/sql_select.cc:1811(JOIN::optimize())[0x558a99f8a7b1]
      sql/sql_lex.cc:4937(st_select_lex::optimize_unflattened_subqueries(bool))[0x558a99d703ee]
      sql/sql_delete.cc:416(mysql_delete(THD*, TABLE_LIST*, Item*, SQL_I_List<st_order>*, unsigned long long, unsigned long long, select_result*))[0x558a99cf55c2]
      sql/sql_parse.cc:4812(mysql_execute_command(THD*, bool))[0x558a99df3907]
      sql/sql_parse.cc:8047(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x558a99dfe5a1]
      sql/sql_parse.cc:1898(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x558a99e0460c]
      sql/sql_parse.cc:1406(do_command(THD*, bool))[0x558a99e0973d]
      sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x558a9a1c4e57]
      sql/sql_connect.cc:1312(handle_one_connection)[0x558a9a1c533d]
      perfschema/pfs.cc:2204(pfs_spawn_thread)[0x558a9ac55c2c]
      pthread_create.c:0(start_thread)[0x7f3f7e6b4259]
      :0(__GI___clone)[0x7f3f7e25f5e3]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x629000087238): DELETE FROM v0 WHERE v3 IN ( SELECT v2 FROM v0 GROUP BY ( SELECT v3 ) )
       
      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/16
      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
      

      gdb bt:

      #0  0x00007f3f7e6bb808 in pthread_kill () from /usr/lib/libpthread.so.0
      #1  0x0000558a9a55906b in handle_fatal_signal (sig=<optimized out>) at /experiment/mariadb-server/sql/signal_handler.cc:344
      #2  <signal handler called>
      #3  0x0000558a9a865b99 in Item_subselect::init_expr_cache_tracker (thd=0x62b0000bd218, this=0x6290000896d8) at /experiment/mariadb-server/sql/item_subselect.cc:7020
      #4  Item_subselect::init_expr_cache_tracker (this=0x6290000896d8, thd=0x62b0000bd218) at /experiment/mariadb-server/sql/item_subselect.cc:7013
      #5  0x0000558a9a865cf9 in Item_singlerow_subselect::expr_cache_insert_transformer (unused=<optimized out>, tmp_thd=0x62b0000bd218, this=0x6290000896d8) at /experiment/mariadb-server/sql/item_subselect.cc:1404
      #6  Item_singlerow_subselect::expr_cache_insert_transformer (this=0x6290000896d8, tmp_thd=0x62b0000bd218, unused=<optimized out>) at /experiment/mariadb-server/sql/item_subselect.cc:1391
      #7  0x0000558a9a595ef1 in Item::transform (this=0x6290000896d8, thd=<optimized out>, transformer=<optimized out>, arg=<optimized out>) at /experiment/mariadb-server/sql/item.cc:610
      #8  0x0000558a99ed6da3 in JOIN::setup_subquery_caches (this=this@entry=0x62900008a640) at /experiment/mariadb-server/sql/sql_select.cc:4235
      #9  0x0000558a99f7e8df in JOIN::optimize_stage2 (this=0x62900008a640) at /experiment/mariadb-server/sql/sql_select.cc:3065
      #10 0x0000558a99f88d07 in JOIN::optimize_inner (this=0x62900008a640) at /experiment/mariadb-server/sql/sql_select.cc:2479
      #11 0x0000558a99f8a7b1 in JOIN::optimize (this=this@entry=0x62900008a640) at /experiment/mariadb-server/sql/sql_select.cc:1809
      #12 0x0000558a99d703ee in st_select_lex::optimize_unflattened_subqueries (this=this@entry=0x62b0000c1bb8, const_only=const_only@entry=false) at /experiment/mariadb-server/sql/sql_lex.cc:4937
      #13 0x0000558a99cf55c2 in mysql_delete (thd=thd@entry=0x62b0000bd218, table_list=<optimized out>, conds=<optimized out>, order_list=order_list@entry=0x62b0000c1ea0, limit=<optimized out>, options=<optimized out>, result=<optimized out>) at /experiment/mariadb-server/sql/sql_delete.cc:416
      #14 0x0000558a99df3907 in mysql_execute_command (thd=0x62b0000bd218, is_called_from_prepared_stmt=<optimized out>) at /experiment/mariadb-server/sql/sql_parse.cc:4807
      #15 0x0000558a99dfe5a1 in mysql_parse (thd=0x62b0000bd218, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /experiment/mariadb-server/sql/sql_parse.cc:8030
      #16 0x0000558a99e0460c 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
      #17 0x0000558a99e0973d in do_command (thd=0x62b0000bd218, blocking=blocking@entry=true) at /experiment/mariadb-server/sql/sql_parse.cc:1404
      #18 0x0000558a9a1c4e57 in do_handle_one_connection (connect=<optimized out>, put_in_cache=<optimized out>) at /experiment/mariadb-server/sql/sql_connect.cc:1418
      #19 0x0000558a9a1c533d in handle_one_connection (arg=arg@entry=0x6080000023b8) at /experiment/mariadb-server/sql/sql_connect.cc:1312
      #20 0x0000558a9ac55c2c in pfs_spawn_thread (arg=0x617000005b98) at /experiment/mariadb-server/storage/perfschema/pfs.cc:2201
      #21 0x00007f3f7e6b4259 in start_thread () from /usr/lib/libpthread.so.0
      #22 0x00007f3f7e25f5e3 in clone () from /usr/lib/libc.so.6
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fuboat Jingzhou Fu
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.