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

Crashes in subselects in choose_best_splitting after upgrade to 10.6.13

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Duplicate
    • 10.6.13
    • N/A
    • Optimizer, Server
    • None
    • Linux nbs 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux

    Description

      Since upgrading from 10.6.9 to 10.6.13 we had repeated crashes causes by queries with subselects:

      230511 7:00:14 [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.6.13-MariaDB-1:10.6.13+maria~deb11-log source revision: a24f2bb50ba4a0dd4127455f7fcdfed584937f36
      key_buffer_size=16777216
      read_buffer_size=16777216
      max_used_connections=141
      max_threads=1002
      thread_count=66
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 24667679 K bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.

      Thread pointer: 0x7f120c0008e8
      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 = 0x7f17142fad18 thread_stack 0x30000
      /usr/sbin/mariadbd(my_print_stacktrace+0x2e)[0x5597a009c75e]
      /usr/sbin/mariadbd(handle_fatal_signal+0x485)[0x55979fb654b5]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x13140)[0x7f1764d21140]
      /usr/sbin/mariadbd(_ZN13st_join_table21choose_best_splittingEjyPy+0x569)[0x55979fae4dd9]
      /usr/sbin/mariadbd(Z16best_access_pathP4JOINP13st_join_tableyPK8POSITIONjbdPS3_S6+0x148)[0x55979f966988]
      /usr/sbin/mariadbd(+0x7f571f)[0x55979f96a71f]
      /usr/sbin/mariadbd(_Z11choose_planP4JOINy+0x2a4)[0x55979f96b534]
      /usr/sbin/mariadbd(+0x8207b1)[0x55979f9957b1]
      /usr/sbin/mariadbd(_ZN4JOIN14optimize_innerEv+0x12ec)[0x55979f99a49c]
      /usr/sbin/mariadbd(_ZN4JOIN8optimizeEv+0xa0)[0x55979f99aab0]
      /usr/sbin/mariadbd(_ZN13st_select_lex31optimize_unflattened_subqueriesEb+0x10d)[0x55979f90773d]
      /usr/sbin/mariadbd(_ZN4JOIN15optimize_stage2Ev+0x3a)[0x55979f9961da]
      /usr/sbin/mariadbd(_ZN4JOIN14optimize_innerEv+0x13fc)[0x55979f99a5ac]
      /usr/sbin/mariadbd(_ZN4JOIN8optimizeEv+0xa0)[0x55979f99aab0]
      /usr/sbin/mariadbd(_Z12mysql_selectP3THDP10TABLE_LISTR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select_resultP18st_select_lex_unitP13st_select_lex+0xb3)[0x55979f99ab83]
      /usr/sbin/mariadbd(_Z13handle_selectP3THDP3LEXP13select_resultm+0x14f)[0x55979f99b38f]
      /usr/sbin/mariadbd(+0x7ac0f1)[0x55979f9210f1]
      /usr/sbin/mariadbd(_Z21mysql_execute_commandP3THDb+0x4607)[0x55979f930267]
      /usr/sbin/mariadbd(_Z11mysql_parseP3THDPcjP12Parser_state+0x1e7)[0x55979f931857]
      /usr/sbin/mariadbd(_Z16dispatch_command19enum_server_commandP3THDPcjb+0x156d)[0x55979f93405d]
      /usr/sbin/mariadbd(_Z10do_commandP3THDb+0x138)[0x55979f935bf8]
      /usr/sbin/mariadbd(_Z24do_handle_one_connectionP7CONNECTb+0x3af)[0x55979fa4470f]
      /usr/sbin/mariadbd(handle_one_connection+0x5d)[0x55979fa44a5d]
      /usr/sbin/mariadbd(+0xc3c4c2)[0x55979fdb14c2]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x7ea7)[0x7f1764d15ea7]
      /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7f176491ca2f]

      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7f120c007c80): SELECT * FROM (SELECT CONCAT(Nachname, ', ', Vorname) AS Name , CONCAT(RIGHT(mo.month, 2), ', ', LEFT(mo.month, 4)) AS Monat , Bildungsgutscheinnummer AS Maßnahmennummer , CONCAT(DATE_FORMAT(Vertrag_Beginn,'%d.%m.%Y'), ' - ', DATE_FORMAT(Vertrag_Ende, '%d.%m.%Y')) AS Maßnahmenzeitraum , (
      SELECT
      SUM(Anzahl)
      FROM
      view_Schüler_Fehlzeit_Monat_Tag vst
      WHERE
      s.Id = vst.Schüler_Id AND
      vst.jahr_monat BETWEEN date_format(Vertrag_Beginn, '%Y-%m') AND mo.month
      ) AS 'Fehltage_gesamt' , f.eins , f.zwei , f.drei , f.vier , f.fünf , f.sechs , f.sieben , f.acht , f.neun , f.zehn , f.elf , f.zwölf , f.dreizehn , f.vierzehn , f.fünfzehn , f.sechzehn , f.siebzehn , f.achtzehn , f.neunzehn , f.zwanzig , f.einundzwanzig , f.zweiundzwanzig , f.dreiundzwanzig , f.vierundzwanzig , f.fünfundzwanzig , f.sechsundzwanzig , f.siebenundzwanzig , f.achtundzwanzig , f.neunundzwanzig , f.dreißig , f.einunddreißig FROM Akademie_Schüler s JOIN const.month mo ON mo.month BETWEEN date_format(Vertrag_Beginn, '%Y-%m') AND
      date_format(ifnull(Vertrag_Ende, CURRENT_DATE), '%Y-%m') LEFT JOIN view_Schüler_Fehlzeit_Monat_Tag f ON f.Schüler_Id = s.Id AND mo.month = jahr_monat WHERE 1=0 ) AS _dummy_table WHERE 1=0 LIMIT 0

      Connection ID (thread ID): 30006
      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,hash_join_cardinality=off

      ----------

      230511 7:30:13 [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.6.13-MariaDB-1:10.6.13+maria~deb11-log source revision: a24f2bb50ba4a0dd4127455f7fcdfed584937f36
      key_buffer_size=16777216
      read_buffer_size=16777216
      max_used_connections=144
      max_threads=1002
      thread_count=105
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 24667679 K bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.

      Thread pointer: 0x7f0ffc0008e8
      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 = 0x7f1684242d18 thread_stack 0x30000
      /usr/sbin/mariadbd(my_print_stacktrace+0x2e)[0x55f596e4c75e]
      /usr/sbin/mariadbd(handle_fatal_signal+0x485)[0x55f5969154b5]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x13140)[0x7f16c69f0140]
      /usr/sbin/mariadbd(_ZN13st_join_table21choose_best_splittingEjyPy+0x569)[0x55f596894dd9]
      /usr/sbin/mariadbd(Z16best_access_pathP4JOINP13st_join_tableyPK8POSITIONjbdPS3_S6+0x148)[0x55f596716988]
      /usr/sbin/mariadbd(+0x7f571f)[0x55f59671a71f]
      /usr/sbin/mariadbd(_Z11choose_planP4JOINy+0x2a4)[0x55f59671b534]
      /usr/sbin/mariadbd(+0x8207b1)[0x55f5967457b1]
      /usr/sbin/mariadbd(_ZN4JOIN14optimize_innerEv+0x12ec)[0x55f59674a49c]
      /usr/sbin/mariadbd(_ZN4JOIN8optimizeEv+0xa0)[0x55f59674aab0]
      /usr/sbin/mariadbd(_ZN13st_select_lex31optimize_unflattened_subqueriesEb+0x10d)[0x55f5966b773d]
      /usr/sbin/mariadbd(_ZN4JOIN15optimize_stage2Ev+0x3a)[0x55f5967461da]
      /usr/sbin/mariadbd(_ZN4JOIN14optimize_innerEv+0x13fc)[0x55f59674a5ac]
      /usr/sbin/mariadbd(_ZN4JOIN8optimizeEv+0xa0)[0x55f59674aab0]
      /usr/sbin/mariadbd(_Z12mysql_selectP3THDP10TABLE_LISTR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select_resultP18st_select_lex_unitP13st_select_lex+0xb3)[0x55f59674ab83]
      /usr/sbin/mariadbd(_Z13handle_selectP3THDP3LEXP13select_resultm+0x14f)[0x55f59674b38f]
      /usr/sbin/mariadbd(+0x7ac0f1)[0x55f5966d10f1]
      /usr/sbin/mariadbd(_Z21mysql_execute_commandP3THDb+0x4607)[0x55f5966e0267]
      /usr/sbin/mariadbd(_Z11mysql_parseP3THDPcjP12Parser_state+0x1e7)[0x55f5966e1857]
      /usr/sbin/mariadbd(_Z16dispatch_command19enum_server_commandP3THDPcjb+0x156d)[0x55f5966e405d]
      /usr/sbin/mariadbd(_Z10do_commandP3THDb+0x138)[0x55f5966e5bf8]
      /usr/sbin/mariadbd(_Z24do_handle_one_connectionP7CONNECTb+0x3af)[0x55f5967f470f]
      /usr/sbin/mariadbd(handle_one_connection+0x5d)[0x55f5967f4a5d]
      /usr/sbin/mariadbd(+0xc3c4c2)[0x55f596b614c2]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x7ea7)[0x7f16c69e4ea7]
      /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7f16c65eba2f]

      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7f0ffc0109e0): SELECT * FROM (SELECT CONCAT(Nachname, ', ', Vorname) AS Name , CONCAT(RIGHT(mo.month, 2), ', ', LEFT(mo.month, 4)) AS Monat , Bildungsgutscheinnummer AS Maßnahmennummer , CONCAT(DATE_FORMAT(Vertrag_Beginn,'%d.%m.%Y'), ' - ', DATE_FORMAT(Vertrag_Ende, '%d.%m.%Y')) AS Maßnahmenzeitraum , (
      SELECT
      SUM(Anzahl)
      FROM
      view_Schüler_Fehlzeit_Monat_Tag vst
      WHERE
      s.Id = vst.Schüler_Id AND
      vst.jahr_monat BETWEEN date_format(Vertrag_Beginn, '%Y-%m') AND mo.month
      ) AS 'Fehltage_gesamt' , f.eins , f.zwei , f.drei , f.vier , f.fünf , f.sechs , f.sieben , f.acht , f.neun , f.zehn , f.elf , f.zwölf , f.dreizehn , f.vierzehn , f.fünfzehn , f.sechzehn , f.siebzehn , f.achtzehn , f.neunzehn , f.zwanzig , f.einundzwanzig , f.zweiundzwanzig , f.dreiundzwanzig , f.vierundzwanzig , f.fünfundzwanzig , f.sechsundzwanzig , f.siebenundzwanzig , f.achtundzwanzig , f.neunundzwanzig , f.dreißig , f.einunddreißig FROM Akademie_Schüler s JOIN const.month mo ON mo.month BETWEEN date_format(Vertrag_Beginn, '%Y-%m') AND
      date_format(ifnull(Vertrag_Ende, CURRENT_DATE), '%Y-%m') LEFT JOIN view_Schüler_Fehlzeit_Monat_Tag f ON f.Schüler_Id = s.Id AND mo.month = jahr_monat WHERE 1=0 ) AS _dummy_table WHERE 1=0 LIMIT 0

      Connection ID (thread ID): 3754
      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,hash_join_cardinality=off
      ------

      Please ignore there where 1=0 and LIMIT 0 stuff - this is something our software does to analyze the possible return values of a query before executing it for real. The crash will reliably also happen on the exact same query if that is left out.

      After further testing: 10.6.12 did not have the crash - it is new for 10.6.13

      I retried on 10.6.13 with debug symbols on a test system:

      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 = 0x7f1dac3c9d18 thread_stack 0x30000
      mysys/stacktrace.c:216(my_print_stacktrace)[0x5605cee2b75e]
      sql/signal_handler.cc:241(handle_fatal_signal)[0x5605ce8f44b5]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x13140)[0x7f1dfda59140]
      sql/opt_split.cc:1047(st_join_table::choose_best_splitting(unsigned int, unsigned long long, unsigned long long*))[0x5605ce873dd9]
      sql/sql_select.cc:7898(best_access_path(JOIN*, st_join_table*, unsigned long long, POSITION const*, unsigned int, bool, double, POSITION*, POSITION*))[0x5605ce6f5988]
      sql/sql_select.cc:10338(best_extension_by_limited_search(JOIN*, unsigned long long, unsigned int, double, double, unsigned int, unsigned int, unsigned int))[0x5605ce6f971f]
      sql/sql_select.cc:9471(choose_plan(JOIN*, unsigned long long))[0x5605ce6fa534]
      sql/sql_select.cc:5963(make_join_statistics(JOIN*, List<TABLE_LIST>&, st_dynamic_array*))[0x5605ce7247b1]
      sql/sql_select.cc:2510(JOIN::optimize_inner())[0x5605ce72949c]
      sql/sql_select.cc:1850(JOIN::optimize())[0x5605ce729ab0]
      sql/sql_lex.cc:4925(st_select_lex::optimize_unflattened_subqueries(bool))[0x5605ce69673d]
      sql/sql_select.cc:3334(JOIN::optimize_stage2())[0x5605ce7251da]
      sql/sql_select.cc:2535(JOIN::optimize_inner())[0x5605ce7295ac]
      sql/sql_select.cc:1850(JOIN::optimize())[0x5605ce729ab0]
      sql/sql_select.cc:5055(mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x5605ce729b83]
      sql/sql_select.cc:559(handle_select(THD*, LEX*, select_result*, unsigned long))[0x5605ce72a38f]
      sql/sql_parse.cc:6273(execute_sqlcom_select(THD*, TABLE_LIST*))[0x5605ce6b00f1]
      sql/sql_parse.cc:3949(mysql_execute_command(THD*, bool))[0x5605ce6bf267]
      sql/sql_class.h:2806(THD::enter_stage(PSI_stage_info_v1 const*, char const*, char const*, unsigned int))[0x5605ce6c0857]
      sql/sql_parse.cc:1898(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x5605ce6c305d]
      sql/sql_parse.cc:1411(do_command(THD*, bool))[0x5605ce6c4bf8]
      sql/sql_connect.cc:1416(do_handle_one_connection(CONNECT*, bool))[0x5605ce7d370f]
      sql/sql_connect.cc:1318(handle_one_connection)[0x5605ce7d3a5d]
      perfschema/pfs.cc:2204(pfs_spawn_thread)[0x5605ceb404c2]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x7ea7)[0x7f1dfda4dea7]
      /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7f1dfd654a2f]

      Attachments

        Issue Links

          Activity

            People

              igor Igor Babaev
              warp Markus Peter
              Votes:
              1 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.