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

Crash with condition pushable into derived and containing outer reference

Details

    Description

      Hello,

      We could see the below error with which mariadb server crashes and reloads

      230511  7:38:01 [ERROR] mysqld got signal 11 ;
      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.20-MariaDB source revision: b735ca47738a1d2e995a429f40afd620eb7d8843
      key_buffer_size=134217728
      read_buffer_size=131072
      max_used_connections=1
      max_threads=602
      thread_count=1
      It is possible that mysqld could use up to 
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1456372 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
       
      Thread pointer: 0x7f8e74000c58
      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 = 0x7f90580aebd8 thread_stack 0x49000
      /usr/sbin/mariadbd(my_print_stacktrace+0x2e)[0x555b3770932e]
      /usr/sbin/mariadbd(handle_fatal_signal+0x485)[0x555b37186825]
      /lib64/libpthread.so.0(+0x12cf0)[0x7f905cb89cf0]
      /usr/sbin/mariadbd(_ZN13st_join_table21choose_best_splittingEjyPy+0x531)[0x555b37109b41]
      /usr/sbin/mariadbd(_Z16best_access_pathP4JOINP13st_join_tableyPK8POSITIONjbdPS3_S6_+0x12b)[0x555b36fbbd2b]
      /usr/sbin/mariadbd(+0x7b440d)[0x555b36fbf40d]
      /usr/sbin/mariadbd(_Z11choose_planP4JOINy+0x262)[0x555b36fbfe32]
      /usr/sbin/mariadbd(_ZN4JOIN14optimize_innerEv+0x344e)[0x555b36fe753e]
      /usr/sbin/mariadbd(_ZN4JOIN8optimizeEv+0xa0)[0x555b36fe7be0]
      /usr/sbin/mariadbd(_ZN13st_select_lex31optimize_unflattened_subqueriesEb+0x12d)[0x555b36f63e1d]
      /usr/sbin/mariadbd(_Z12mysql_updateP3THDP10TABLE_LISTR4ListI4ItemES6_PS4_jP8st_orderybPySA_+0x651)[0x555b3703b2b1]
      /usr/sbin/mariadbd(_Z21mysql_execute_commandP3THD+0x31cf)[0x555b36f8cef1]
      /usr/sbin/mariadbd(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x247)[0x555b36f7cb0a]
      /usr/sbin/mariadbd(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0x1dc2)[0x555b36f880a7]
      /usr/sbin/mariadbd(_Z10do_commandP3THD+0x11e)[0x555b36f89265]
      /usr/sbin/mariadbd(_Z24do_handle_one_connectionP7CONNECTb+0x501)[0x555b370805b1]
      /usr/sbin/mariadbd(handle_one_connection+0x5d)[0x555b3708090d]
      /usr/sbin/mariadbd(+0xba7ea3)[0x555b373b2ea3]
      /lib64/libpthread.so.0(+0x81cf)[0x7f905cb7f1cf]
      /lib64/libc.so.6(clone+0x43)[0x7f905becfe73]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7f8e74012d10): UPDATE mdlov_report_coursesize rc
                          SET backupsize = (SELECT bf.filesize FROM (SELECT id AS course, SUM(filesize) AS filesize
                    FROM (SELECT c.id, f.filesize
                            FROM mdlov_course c
                            JOIN mdlov_context cx ON cx.contextlevel = 50 AND cx.instanceid = c.id
                            JOIN mdlov_files f ON f.contextid = cx.id AND f.component = 'backup') x
                  GROUP BY id) bf WHERE bf.course = rc.course)
       
      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 /var/lib/mysql
      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        0                    unlimited            bytes     
      Max resident set          unlimited            unlimited            bytes     
      Max processes             256596               256596               processes 
      Max open files            40000                40000                files     
      Max locked memory         65536                65536                bytes     
      Max address space         unlimited            unlimited            bytes     
      Max file locks            unlimited            unlimited            locks     
      Max pending signals       256596               256596               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: |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e
      

      Attachments

        Issue Links

          Activity

            nathang Nathan created issue -
            danblack Daniel Black made changes -
            Field Original Value New Value
            danblack Daniel Black added a comment -

            Can you install the debug symbols with sudo yum install gdb MariaDB-server-debuginfo and then include the output from:

            On the assumption that the core dump was saved, can you try:

            $ coredumpctl debug
             
            set pagination off
            set print frame-arguments all
            bt full
            

            And include this output.

            danblack Daniel Black added a comment - Can you install the debug symbols with sudo yum install gdb MariaDB-server-debuginfo and then include the output from: On the assumption that the core dump was saved, can you try: $ coredumpctl debug   set pagination off set print frame-arguments all bt full And include this output.
            danblack Daniel Black made changes -
            danblack Daniel Black made changes -
            Component/s Optimizer [ 10200 ]
            danblack Daniel Black made changes -
            Fix Version/s 10.4 [ 22408 ]
            danblack Daniel Black made changes -
            Assignee Igor Babaev [ igor ]
            nathang Nathan added a comment -

            I downgraded the MariaDB version back to 10.5.19 since all the sites were down. This is a production server so won't be able to generate the log now

            nathang Nathan added a comment - I downgraded the MariaDB version back to 10.5.19 since all the sites were down. This is a production server so won't be able to generate the log now
            psergei Sergei Petrunia made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]

            A testcase:

             
            create table t1 (
              a int
            );
            insert into t1 select seq from seq_1_to_1000;
             
            create table t2 (
              a int,
              b int,
              key (a)
            );
             
            create table one (a int);
            insert into one values (1);
             
            insert into t2 select mod(seq,10), mod(seq,10) from seq_1_to_1000;
            analyze table t2 persistent for all;
             
            explain
            select 
              a,
              (select
                 concat(one.a,'=',T2_GRP.SUM_B)
               from 
                 (select a, sum(b) as SUM_B from t2 group by a) as T2_GRP,
                 one
               where
                  T2_GRP.a=t1.a
              )
            from t1;
            

              Thread 34 "mysqld" received signal SIGSEGV, Segmentation fault.
              [Switching to Thread 0x7fffcafb4700 (LWP 7734)]
              0x0000555555ffaec6 in st_join_table::choose_best_splitting (this=0x7fff740bd1e8, idx=1, remaining_tables=1, spl_pd_boundary=0x7fffcafb1340) at /home/psergey/   dev-git2/10.4-look/sql/opt_split.cc:1049
            (gdb) wher
              #0  0x0000555555ffaec6 in st_join_table::choose_best_splitting (this=0x7fff740bd1e8, idx=1, remaining_tables=1, spl_pd_boundary=0x7fffcafb1340) at /home/       psergey/dev-git2/10.4-look/sql/opt_split.cc:1049
              #1  0x0000555555df5ad3 in best_access_path (join=0x7fff740b5fe8, s=0x7fff740bd1e8, remaining_tables=1, join_positions=0x7fff740bdb58, idx=1,                    disable_jbuf=false, record_count=1, pos=0x7fff740bdc98, loose_scan_pos=0x7fffcafb1700) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:7468
              #2  0x0000555555dfc75b in best_extension_by_limited_search (join=0x7fff740b5fe8, remaining_tables=1, idx=1, record_count=1, read_time=1.2, search_depth=61,     prune_level=1, use_cond_selectivity=4) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:9778
              #3  0x0000555555dfcecf in best_extension_by_limited_search (join=0x7fff740b5fe8, remaining_tables=3, idx=0, record_count=1, read_time=0, search_depth=62,       prune_level=1, use_cond_selectivity=4) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:9867
              #4  0x0000555555dfa5b9 in greedy_search (join=0x7fff740b5fe8, remaining_tables=3, search_depth=62, prune_level=1, use_cond_selectivity=4) at /home/psergey/dev- git2/10.4-look/sql/sql_select.cc:8948
              #5  0x0000555555df97cb in choose_plan (join=0x7fff740b5fe8, join_tables=3) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:8510
              #6  0x0000555555df0f31 in make_join_statistics (join=0x7fff740b5fe8, tables_list=@0x7fff74016150: {<base_list> = {<Sql_alloc> = {<No data fields>}, first =     0x7fff740b6eb0, last = 0x7fff740b6ec0, elements = 2}, <No data fields>}, keyuse_array=0x7fff740b62d8) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:5711
              #7  0x0000555555de4a71 in JOIN::optimize_inner (this=0x7fff740b5fe8) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:2368
              #8  0x0000555555de2324 in JOIN::optimize (this=0x7fff740b5fe8) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:1711
              #9  0x0000555555d64fef in st_select_lex::optimize_unflattened_subqueries (this=0x7fff74015920, const_only=false) at /home/psergey/dev-git2/10.4-look/sql/       sql_lex.cc:4236
              #10 0x0000555555f950b8 in JOIN::optimize_unflattened_subqueries (this=0x7fff740b55e0) at /home/psergey/dev-git2/10.4-look/sql/opt_subselect.cc:5602
              #11 0x0000555555de6c4b in JOIN::optimize_stage2 (this=0x7fff740b55e0) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:2942
              #12 0x0000555555de4b70 in JOIN::optimize_inner (this=0x7fff740b55e0) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:2394 
              #13 0x0000555555de2324 in JOIN::optimize (this=0x7fff740b55e0) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:1711
              #14 0x0000555555dedb0d in mysql_select (thd=0x7fff74000d50, tables=0x7fff7401a0f8, wild_num=0, fields=@0x7fff74015a80: {<base_list> = {<Sql_alloc> = {<No data  fields>}, first = 0x7fff74015ef0, last = 0x7fff74019fb0, elements = 2}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748612, result=0x7fff7401b1b0, unit=0x7fff74004c88, select_lex=0x7fff74015920) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:4812
            

             

            (gdb) p pos->table
            $7 = (JOIN_TAB *) 0xa5a5a5a5a5a5a5a5
            (gdb) p pos - this->join->positions
            $9 = -1
            (gdb) p refills
            $11 = 1
            (gdb) print last_found
            $13 = 2
            (gdb) p/x best_param_tables
            $14 = 0x4000000000000000

            {gdb}
            psergei Sergei Petrunia added a comment - A testcase:   create table t1 ( a int ); insert into t1 select seq from seq_1_to_1000;   create table t2 ( a int , b int , key (a) );   create table one (a int ); insert into one values (1);   insert into t2 select mod(seq,10), mod(seq,10) from seq_1_to_1000; analyze table t2 persistent for all ;   explain select a, ( select concat(one.a, '=' ,T2_GRP.SUM_B) from ( select a, sum (b) as SUM_B from t2 group by a) as T2_GRP, one where T2_GRP.a=t1.a ) from t1; Thread 34 "mysqld" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffcafb4700 (LWP 7734)] 0x0000555555ffaec6 in st_join_table::choose_best_splitting (this=0x7fff740bd1e8, idx=1, remaining_tables=1, spl_pd_boundary=0x7fffcafb1340) at /home/psergey/ dev-git2/10.4-look/sql/opt_split.cc:1049 (gdb) wher #0 0x0000555555ffaec6 in st_join_table::choose_best_splitting (this=0x7fff740bd1e8, idx=1, remaining_tables=1, spl_pd_boundary=0x7fffcafb1340) at /home/ psergey/dev-git2/10.4-look/sql/opt_split.cc:1049 #1 0x0000555555df5ad3 in best_access_path (join=0x7fff740b5fe8, s=0x7fff740bd1e8, remaining_tables=1, join_positions=0x7fff740bdb58, idx=1, disable_jbuf=false, record_count=1, pos=0x7fff740bdc98, loose_scan_pos=0x7fffcafb1700) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:7468 #2 0x0000555555dfc75b in best_extension_by_limited_search (join=0x7fff740b5fe8, remaining_tables=1, idx=1, record_count=1, read_time=1.2, search_depth=61, prune_level=1, use_cond_selectivity=4) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:9778 #3 0x0000555555dfcecf in best_extension_by_limited_search (join=0x7fff740b5fe8, remaining_tables=3, idx=0, record_count=1, read_time=0, search_depth=62, prune_level=1, use_cond_selectivity=4) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:9867 #4 0x0000555555dfa5b9 in greedy_search (join=0x7fff740b5fe8, remaining_tables=3, search_depth=62, prune_level=1, use_cond_selectivity=4) at /home/psergey/dev- git2/10.4-look/sql/sql_select.cc:8948 #5 0x0000555555df97cb in choose_plan (join=0x7fff740b5fe8, join_tables=3) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:8510 #6 0x0000555555df0f31 in make_join_statistics (join=0x7fff740b5fe8, tables_list=@0x7fff74016150: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7fff740b6eb0, last = 0x7fff740b6ec0, elements = 2}, <No data fields>}, keyuse_array=0x7fff740b62d8) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:5711 #7 0x0000555555de4a71 in JOIN::optimize_inner (this=0x7fff740b5fe8) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:2368 #8 0x0000555555de2324 in JOIN::optimize (this=0x7fff740b5fe8) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:1711 #9 0x0000555555d64fef in st_select_lex::optimize_unflattened_subqueries (this=0x7fff74015920, const_only=false) at /home/psergey/dev-git2/10.4-look/sql/ sql_lex.cc:4236 #10 0x0000555555f950b8 in JOIN::optimize_unflattened_subqueries (this=0x7fff740b55e0) at /home/psergey/dev-git2/10.4-look/sql/opt_subselect.cc:5602 #11 0x0000555555de6c4b in JOIN::optimize_stage2 (this=0x7fff740b55e0) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:2942 #12 0x0000555555de4b70 in JOIN::optimize_inner (this=0x7fff740b55e0) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:2394 #13 0x0000555555de2324 in JOIN::optimize (this=0x7fff740b55e0) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:1711 #14 0x0000555555dedb0d in mysql_select (thd=0x7fff74000d50, tables=0x7fff7401a0f8, wild_num=0, fields=@0x7fff74015a80: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7fff74015ef0, last = 0x7fff74019fb0, elements = 2}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748612, result=0x7fff7401b1b0, unit=0x7fff74004c88, select_lex=0x7fff74015920) at /home/psergey/dev-git2/10.4-look/sql/sql_select.cc:4812   (gdb) p pos->table $7 = (JOIN_TAB *) 0xa5a5a5a5a5a5a5a5 (gdb) p pos - this->join->positions $9 = -1 (gdb) p refills $11 = 1 (gdb) print last_found $13 = 2 (gdb) p/x best_param_tables $14 = 0x4000000000000000 {gdb}
            psergei Sergei Petrunia added a comment - A patch: https://github.com/MariaDB/server/tree/bb-10.4-mdev31240
            igor Igor Babaev (Inactive) made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            igor Igor Babaev (Inactive) made changes -
            Summary MariaDB server Crashing After Upgrade to 10.5.20 from 10.5.19 Crash with condition pushable into derived and containing outer reference
            danblack Daniel Black made changes -
            Labels 10.5.20-MariaDB mariadb, regression
            danblack Daniel Black made changes -
            danblack Daniel Black made changes -

            See also bb-10.4-igor

            igor Igor Babaev (Inactive) added a comment - See also bb-10.4-igor
            igor Igor Babaev (Inactive) made changes -
            Assignee Igor Babaev [ igor ] Sergei Petrunia [ psergey ]
            Status In Progress [ 3 ] In Review [ 10002 ]

            Ok to push. (Now looking which branch should this go into)

            psergei Sergei Petrunia added a comment - Ok to push. (Now looking which branch should this go into)
            psergei Sergei Petrunia made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            psergei Sergei Petrunia made changes -
            Affects Version/s 10.4 [ 22408 ]
            Affects Version/s 10.6 [ 24028 ]
            Affects Version/s 10.8 [ 26121 ]
            Affects Version/s 10.9 [ 26905 ]
            Affects Version/s 10.10 [ 27530 ]
            Affects Version/s 10.11 [ 27614 ]
            psergei Sergei Petrunia made changes -
            Fix Version/s 11.0.2 [ 28706 ]
            Fix Version/s 10.4.30 [ 28912 ]
            Fix Version/s 10.5.21 [ 28913 ]
            Fix Version/s 10.6.14 [ 28914 ]
            Fix Version/s 10.8.9 [ 28915 ]
            Fix Version/s 10.9.7 [ 28916 ]
            Fix Version/s 10.11.4 [ 28918 ]
            Fix Version/s 10.4 [ 22408 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.8.9 [ 28915 ]
            danblack Daniel Black made changes -
            danblack Daniel Black added a comment - - edited

            I've verified that optimizer_switch="split_materialized=off" would avoid a crash for those on an affected version.

            danblack Daniel Black added a comment - - edited I've verified that optimizer_switch="split_materialized=off" would avoid a crash for those on an affected version.
            ralf.gebhardt Ralf Gebhardt made changes -
            Affects Version/s 10.11.3 [ 28524 ]
            Affects Version/s 10.10.4 [ 28522 ]
            Affects Version/s 10.9.6 [ 28520 ]
            Affects Version/s 10.8.8 [ 28518 ]
            Affects Version/s 10.6.13 [ 28514 ]
            Affects Version/s 10.4.29 [ 28510 ]
            Affects Version/s 11.1.1 [ 28704 ]
            Affects Version/s 10.4 [ 22408 ]
            Affects Version/s 10.6 [ 24028 ]
            Affects Version/s 10.8 [ 26121 ]
            Affects Version/s 10.9 [ 26905 ]
            Affects Version/s 10.10 [ 27530 ]
            Affects Version/s 10.11 [ 27614 ]
            Priority Major [ 3 ] Blocker [ 1 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            psergei Sergei Petrunia made changes -
            Fix Version/s 11.0.2 [ 28706 ]
            danblack Daniel Black made changes -
            alice Alice Sherepa made changes -
            serg Sergei Golubchik made changes -
            Description Hello,

            We could see the below error with which mariadb server crashes and reloads


            230511 7:38:01 [ERROR] mysqld got signal 11 ;
            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.20-MariaDB source revision: b735ca47738a1d2e995a429f40afd620eb7d8843
            key_buffer_size=134217728
            read_buffer_size=131072
            max_used_connections=1
            max_threads=602
            thread_count=1
            It is possible that mysqld could use up to
            key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1456372 K bytes of memory
            Hope that's ok; if not, decrease some variables in the equation.

            Thread pointer: 0x7f8e74000c58
            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 = 0x7f90580aebd8 thread_stack 0x49000
            /usr/sbin/mariadbd(my_print_stacktrace+0x2e)[0x555b3770932e]
            /usr/sbin/mariadbd(handle_fatal_signal+0x485)[0x555b37186825]
            /lib64/libpthread.so.0(+0x12cf0)[0x7f905cb89cf0]
            /usr/sbin/mariadbd(_ZN13st_join_table21choose_best_splittingEjyPy+0x531)[0x555b37109b41]
            /usr/sbin/mariadbd(_Z16best_access_pathP4JOINP13st_join_tableyPK8POSITIONjbdPS3_S6_+0x12b)[0x555b36fbbd2b]
            /usr/sbin/mariadbd(+0x7b440d)[0x555b36fbf40d]
            /usr/sbin/mariadbd(_Z11choose_planP4JOINy+0x262)[0x555b36fbfe32]
            /usr/sbin/mariadbd(_ZN4JOIN14optimize_innerEv+0x344e)[0x555b36fe753e]
            /usr/sbin/mariadbd(_ZN4JOIN8optimizeEv+0xa0)[0x555b36fe7be0]
            /usr/sbin/mariadbd(_ZN13st_select_lex31optimize_unflattened_subqueriesEb+0x12d)[0x555b36f63e1d]
            /usr/sbin/mariadbd(_Z12mysql_updateP3THDP10TABLE_LISTR4ListI4ItemES6_PS4_jP8st_orderybPySA_+0x651)[0x555b3703b2b1]
            /usr/sbin/mariadbd(_Z21mysql_execute_commandP3THD+0x31cf)[0x555b36f8cef1]
            /usr/sbin/mariadbd(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x247)[0x555b36f7cb0a]
            /usr/sbin/mariadbd(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0x1dc2)[0x555b36f880a7]
            /usr/sbin/mariadbd(_Z10do_commandP3THD+0x11e)[0x555b36f89265]
            /usr/sbin/mariadbd(_Z24do_handle_one_connectionP7CONNECTb+0x501)[0x555b370805b1]
            /usr/sbin/mariadbd(handle_one_connection+0x5d)[0x555b3708090d]
            /usr/sbin/mariadbd(+0xba7ea3)[0x555b373b2ea3]
            /lib64/libpthread.so.0(+0x81cf)[0x7f905cb7f1cf]
            /lib64/libc.so.6(clone+0x43)[0x7f905becfe73]

            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7f8e74012d10): UPDATE mdlov_report_coursesize rc
                                SET backupsize = (SELECT bf.filesize FROM (SELECT id AS course, SUM(filesize) AS filesize
                          FROM (SELECT c.id, f.filesize
                                  FROM mdlov_course c
                                  JOIN mdlov_context cx ON cx.contextlevel = 50 AND cx.instanceid = c.id
                                  JOIN mdlov_files f ON f.contextid = cx.id AND f.component = 'backup') x
                        GROUP BY id) bf WHERE bf.course = rc.course)

            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 /var/lib/mysql
            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 0 unlimited bytes
            Max resident set unlimited unlimited bytes
            Max processes 256596 256596 processes
            Max open files 40000 40000 files
            Max locked memory 65536 65536 bytes
            Max address space unlimited unlimited bytes
            Max file locks unlimited unlimited locks
            Max pending signals 256596 256596 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: |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e
            Hello,

            We could see the below error with which mariadb server crashes and reloads

            {noformat}
            230511 7:38:01 [ERROR] mysqld got signal 11 ;
            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.20-MariaDB source revision: b735ca47738a1d2e995a429f40afd620eb7d8843
            key_buffer_size=134217728
            read_buffer_size=131072
            max_used_connections=1
            max_threads=602
            thread_count=1
            It is possible that mysqld could use up to
            key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1456372 K bytes of memory
            Hope that's ok; if not, decrease some variables in the equation.

            Thread pointer: 0x7f8e74000c58
            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 = 0x7f90580aebd8 thread_stack 0x49000
            /usr/sbin/mariadbd(my_print_stacktrace+0x2e)[0x555b3770932e]
            /usr/sbin/mariadbd(handle_fatal_signal+0x485)[0x555b37186825]
            /lib64/libpthread.so.0(+0x12cf0)[0x7f905cb89cf0]
            /usr/sbin/mariadbd(_ZN13st_join_table21choose_best_splittingEjyPy+0x531)[0x555b37109b41]
            /usr/sbin/mariadbd(_Z16best_access_pathP4JOINP13st_join_tableyPK8POSITIONjbdPS3_S6_+0x12b)[0x555b36fbbd2b]
            /usr/sbin/mariadbd(+0x7b440d)[0x555b36fbf40d]
            /usr/sbin/mariadbd(_Z11choose_planP4JOINy+0x262)[0x555b36fbfe32]
            /usr/sbin/mariadbd(_ZN4JOIN14optimize_innerEv+0x344e)[0x555b36fe753e]
            /usr/sbin/mariadbd(_ZN4JOIN8optimizeEv+0xa0)[0x555b36fe7be0]
            /usr/sbin/mariadbd(_ZN13st_select_lex31optimize_unflattened_subqueriesEb+0x12d)[0x555b36f63e1d]
            /usr/sbin/mariadbd(_Z12mysql_updateP3THDP10TABLE_LISTR4ListI4ItemES6_PS4_jP8st_orderybPySA_+0x651)[0x555b3703b2b1]
            /usr/sbin/mariadbd(_Z21mysql_execute_commandP3THD+0x31cf)[0x555b36f8cef1]
            /usr/sbin/mariadbd(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x247)[0x555b36f7cb0a]
            /usr/sbin/mariadbd(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0x1dc2)[0x555b36f880a7]
            /usr/sbin/mariadbd(_Z10do_commandP3THD+0x11e)[0x555b36f89265]
            /usr/sbin/mariadbd(_Z24do_handle_one_connectionP7CONNECTb+0x501)[0x555b370805b1]
            /usr/sbin/mariadbd(handle_one_connection+0x5d)[0x555b3708090d]
            /usr/sbin/mariadbd(+0xba7ea3)[0x555b373b2ea3]
            /lib64/libpthread.so.0(+0x81cf)[0x7f905cb7f1cf]
            /lib64/libc.so.6(clone+0x43)[0x7f905becfe73]

            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7f8e74012d10): UPDATE mdlov_report_coursesize rc
                                SET backupsize = (SELECT bf.filesize FROM (SELECT id AS course, SUM(filesize) AS filesize
                          FROM (SELECT c.id, f.filesize
                                  FROM mdlov_course c
                                  JOIN mdlov_context cx ON cx.contextlevel = 50 AND cx.instanceid = c.id
                                  JOIN mdlov_files f ON f.contextid = cx.id AND f.component = 'backup') x
                        GROUP BY id) bf WHERE bf.course = rc.course)

            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 /var/lib/mysql
            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 0 unlimited bytes
            Max resident set unlimited unlimited bytes
            Max processes 256596 256596 processes
            Max open files 40000 40000 files
            Max locked memory 65536 65536 bytes
            Max address space unlimited unlimited bytes
            Max file locks unlimited unlimited locks
            Max pending signals 256596 256596 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: |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e
            {noformat}
            serg Sergei Golubchik made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            dbart Daniel Bartholomew made changes -
            Fix Version/s 10.4.31 [ 29010 ]
            Fix Version/s 10.5.22 [ 29011 ]
            Fix Version/s 10.6.15 [ 29013 ]
            Fix Version/s 10.9.8 [ 29015 ]
            Fix Version/s 10.11.5 [ 29019 ]
            Fix Version/s 10.4.30 [ 28912 ]
            Fix Version/s 10.5.21 [ 28913 ]
            Fix Version/s 10.6.14 [ 28914 ]
            Fix Version/s 10.9.7 [ 28916 ]
            Fix Version/s 10.11.4 [ 28918 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.11.4 [ 28918 ]
            Fix Version/s 10.10.5 [ 28917 ]
            Fix Version/s 10.9.7 [ 28916 ]
            Fix Version/s 10.6.14 [ 28914 ]
            Fix Version/s 10.5.21 [ 28913 ]
            Fix Version/s 10.4.30 [ 28912 ]
            Fix Version/s 10.4.31 [ 29010 ]
            Fix Version/s 10.5.22 [ 29011 ]
            Fix Version/s 10.6.15 [ 29013 ]
            Fix Version/s 10.9.8 [ 29015 ]
            Fix Version/s 10.11.5 [ 29019 ]

            danblack wrote:

            I've verified that optimizer_switch="split_materialized=off" would avoid a crash for those on an affected version.

            This (SET SESSION optimizer_switch='split_materialized=off') appears to also avoid a crash on 10.4.29 for the related crash described in MDEV-31403.

            dlenski Daniel Lenski (Inactive) added a comment - danblack wrote: I've verified that optimizer_switch="split_materialized=off" would avoid a crash for those on an affected version. This ( SET SESSION optimizer_switch='split_materialized=off' ) appears to also avoid a crash on 10.4.29 for the related crash described in MDEV-31403 .
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 159949

            People

              psergei Sergei Petrunia
              nathang Nathan
              Votes:
              0 Vote for this issue
              Watchers:
              14 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.