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

Server crashes in in create_tmp_table / JOIN::create_postjoin_aggr_table

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.2(EOL)
    • N/A
    • Optimizer
    • None

    Description

      Stack trace from 10.2 54b81ac57f

      # 2016-09-14T01:37:18 [9093] #3  <signal handler called>
      # 2016-09-14T01:37:18 [9093] #4  __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:166
      # 2016-09-14T01:37:18 [9093] #5  0x00007f4df11350bd in create_tmp_table (thd=0x7f4dc1816070, param=0x7f4dc1866568, fields=..., group=0x0, distinct=false, save_sum_fields=true, select_options=551903562497, rows_limit=18446744073709551615, table_alias=0x7f4df1a272a7 "", do_not_open=true, keep_row_order=false) at /data/src/10.2/sql/sql_select.cc:16667
      # 2016-09-14T01:37:18 [9093] #6  0x00007f4df111211f in JOIN::create_postjoin_aggr_table (this=0x7f4dc18640a0, tab=0x7f4dc1865a38, table_fields=0x7f4dc18643c8, table_group=0x0, save_sum_fields=true, distinct=false, keep_row_order=false) at /data/src/10.2/sql/sql_select.cc:2725
      # 2016-09-14T01:37:18 [9093] #7  0x00007f4df1110c75 in JOIN::make_aggr_tables_info (this=0x7f4dc18640a0) at /data/src/10.2/sql/sql_select.cc:2414
      # 2016-09-14T01:37:18 [9093] #8  0x00007f4df110fa03 in JOIN::optimize_inner (this=0x7f4dc18640a0) at /data/src/10.2/sql/sql_select.cc:2085
      # 2016-09-14T01:37:18 [9093] #9  0x00007f4df110c3f8 in JOIN::optimize (this=0x7f4dc18640a0) at /data/src/10.2/sql/sql_select.cc:1076
      # 2016-09-14T01:37:18 [9093] #10 0x00007f4df111484c in mysql_select (thd=0x7f4dc1816070, tables=0x7f4dc1863428, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, group=0x7f4dc1863f60, having=0x0, proc_param=0x0, select_options=551903562497, result=0x7f4dc1864080, unit=0x7f4dc1819b18, select_lex=0x7f4dc181a250) at /data/src/10.2/sql/sql_select.cc:3535
      # 2016-09-14T01:37:18 [9093] #11 0x00007f4df1109f55 in handle_select (thd=0x7f4dc1816070, lex=0x7f4dc1819a50, result=0x7f4dc1864080, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:373
      # 2016-09-14T01:37:18 [9093] #12 0x00007f4df10d99ec in execute_sqlcom_select (thd=0x7f4dc1816070, all_tables=0x7f4dc1863428) at /data/src/10.2/sql/sql_parse.cc:6345
      # 2016-09-14T01:37:18 [9093] #13 0x00007f4df10cf822 in mysql_execute_command (thd=0x7f4dc1816070) at /data/src/10.2/sql/sql_parse.cc:3376
      # 2016-09-14T01:37:18 [9093] #14 0x00007f4df10dd18b in mysql_parse (thd=0x7f4dc1816070, rawbuf=0x7f4dc1863088 "SELECT DISTINCT DEFAULT(pk) FROM t1 GROUP BY @A := 1 WITH ROLLUP /* QUERY_NO 4 CON_ID 6 */", length=90, parser_state=0x7f4df1fbee20, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7774
      # 2016-09-14T01:37:18 [9093] #15 0x00007f4df10cb579 in dispatch_command (command=COM_QUERY, thd=0x7f4dc1816070, packet=0x7f4dc1854071 "SELECT DISTINCT DEFAULT(pk) FROM t1 GROUP BY @A := 1 WITH ROLLUP /* QUERY_NO 4 CON_ID 6 */ ", packet_length=91, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1805
      # 2016-09-14T01:37:18 [9093] #16 0x00007f4df10c9faa in do_command (thd=0x7f4dc1816070) at /data/src/10.2/sql/sql_parse.cc:1365
      # 2016-09-14T01:37:18 [9093] #17 0x00007f4df1205936 in do_handle_one_connection (connect=0x7f4dee05cc90) at /data/src/10.2/sql/sql_connect.cc:1354
      # 2016-09-14T01:37:18 [9093] #18 0x00007f4df12056c3 in handle_one_connection (arg=0x7f4dee05cc90) at /data/src/10.2/sql/sql_connect.cc:1260
      # 2016-09-14T01:37:18 [9093] #19 0x00007f4df074e0a4 in start_thread (arg=0x7f4df1fc0300) at pthread_create.c:309
      # 2016-09-14T01:37:18 [9093] #20 0x00007f4dee90687d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      RQG command line

      perl ./runall-new.pl --grammar=/data/tmp/1.yy --duration=300 --threads=2 --queries=100M --skip-gendata \
      --basedir=<basedir> --vardir=<vardir>
      

      1.yy

      thread1_init:
            CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB
          ; INSERT INTO t1 () VALUES 
              (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
              (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
              (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
              (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
              (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),()
      ;
       
      thread1: 
          SELECT DISTINCT DEFAULT(pk) FROM t1 GROUP BY @A := 1 WITH ROLLUP; 
       
      thread2:
          SELECT COUNT(*) FROM t1;
      

      The problem appeared in 10.2 tree after one of the recent merges, most likely somewhere between addb38f476 and 4de75afb45.
      There is another similar crash in previous versions, MDEV-10780. However, the stack trace is somewhat different there, besides, the test above does not crash on previous versions or on 10.2 builds before the merge.

      Still, quite possibly MDEV-10806 is a duplicate of MDEV-10780, just a different representation which only started happening due to recent changes.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.