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

Server crashes in in create_tmp_table

Details

    • 10.1.18

    Description

      Stack trace from 10.0 b34d7fba31

      #3  <signal handler called>
      #4  __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:166
      #5  0x00000000006a37fd in create_tmp_table (thd=0x7fce94aa1070, param=0x7fce9282ef98, fields=..., group=0x0, distinct=false, save_sum_fields=true, select_options=2147748609, rows_limit=18446744073709551615, table_alias=0xe9b7ff "", do_not_open=false, keep_row_order=false) at /data/src/10.0/sql/sql_select.cc:16319
      #6  0x00000000006827e2 in JOIN::exec_inner (this=0x7fce92825048) at /data/src/10.0/sql/sql_select.cc:2756
      #7  0x0000000000681216 in JOIN::exec (this=0x7fce92825048) at /data/src/10.0/sql/sql_select.cc:2373
      #8  0x000000000068457e in mysql_select (thd=0x7fce94aa1070, rref_pointer_array=0x7fce94aa5378, tables=0x7fce92824428, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, group=0x7fce92824f38, having=0x0, proc_param=0x0, select_options=2147748609, result=0x7fce92825028, unit=0x7fce94aa4a10, select_lex=0x7fce94aa5100) at /data/src/10.0/sql/sql_select.cc:3308
      #9  0x000000000067a93a in handle_select (thd=0x7fce94aa1070, lex=0x7fce94aa4948, result=0x7fce92825028, setup_tables_done_option=0) at /data/src/10.0/sql/sql_select.cc:373
      #10 0x000000000064f197 in execute_sqlcom_select (thd=0x7fce94aa1070, all_tables=0x7fce92824428) at /data/src/10.0/sql/sql_parse.cc:5294
      #11 0x00000000006476c2 in mysql_execute_command (thd=0x7fce94aa1070) at /data/src/10.0/sql/sql_parse.cc:2563
      #12 0x0000000000651e18 in mysql_parse (thd=0x7fce94aa1070, rawbuf=0x7fce92824088 "SELECT DISTINCT DEFAULT( `pk` ) FROM t1 GROUP BY @A := 1 WITH ROLLUP", length=68, parser_state=0x7fce9cc2c650) at /data/src/10.0/sql/sql_parse.cc:6576
      #13 0x0000000000644918 in dispatch_command (command=COM_QUERY, thd=0x7fce94aa1070, packet=0x7fce94aa7071 "SELECT DISTINCT DEFAULT( `pk` ) FROM t1 GROUP BY @A := 1 WITH ROLLUP", packet_length=68) at /data/src/10.0/sql/sql_parse.cc:1309
      #14 0x0000000000643bdb in do_command (thd=0x7fce94aa1070) at /data/src/10.0/sql/sql_parse.cc:999
      #15 0x0000000000761efa in do_handle_one_connection (thd_arg=0x7fce94aa1070) at /data/src/10.0/sql/sql_connect.cc:1378
      #16 0x0000000000761c6c in handle_one_connection (arg=0x7fce94aa1070) at /data/src/10.0/sql/sql_connect.cc:1293
      #17 0x00000000009faa88 in pfs_spawn_thread (arg=0x7fce9498fa70) at /data/src/10.0/storage/perfschema/pfs.cc:1860
      #18 0x00007fce9c8b20a4 in start_thread (arg=0x7fce9cc2d700) at pthread_create.c:309
      #19 0x00007fce9aa6a87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      MTR test (run with --repeat=N)

      DROP TABLE IF EXISTS t1;
       
      CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=MyISAM;
      INSERT INTO t1 () VALUES 
      (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
      (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
      (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
      (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
      (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),();
       
      --connect (con1,127.0.0.1,root,,test)
      --send
      SELECT * FROM t1;
       
      --connect (con2,127.0.0.1,root,,test)
      SELECT DISTINCT DEFAULT( `pk` ) FROM t1 GROUP BY @A := 1 WITH ROLLUP; 
       
      --connection con1
      --reap
       
      --disconnect con1
      --disconnect con2
       
      --connection default
      DROP TABLE t1;
      

      Reproducible on 10.0, 10.1.
      Not reproducible on 5.5.
      Not reproducible with this test on 10.2, but see MDEV-10806.

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            Description http://buildbot.askmonty.org/buildbot/builders/win-rqg-se/builds/2677/steps/rqg_crash_tests/logs/stdio
            {noformat}
            160907 15:59:51 [ERROR] mysqld got exception 0xc0000005 ;
            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.2.2-MariaDB-debug-log
            key_buffer_size=1048576
            read_buffer_size=131072
            max_used_connections=7
            max_threads=1001
            thread_count=6
            It is possible that mysqld could use up to
            key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 388178 K bytes of memory
            Hope that's ok; if not, decrease some variables in the equation.

            Thread pointer: 0x0x7ac0725fb8
            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...
            mysqld.exe!MoveSmall()[memcpy.asm:253]
            mysqld.exe!create_tmp_table()[sql_select.cc:16663]
            mysqld.exe!JOIN::create_postjoin_aggr_table()[sql_select.cc:2717]
            mysqld.exe!JOIN::make_aggr_tables_info()[sql_select.cc:2408]
            mysqld.exe!JOIN::optimize_inner()[sql_select.cc:2077]
            mysqld.exe!JOIN::optimize()[sql_select.cc:1072]
            mysqld.exe!mysql_select()[sql_select.cc:3526]
            mysqld.exe!handle_select()[sql_select.cc:373]
            mysqld.exe!execute_sqlcom_select()[sql_parse.cc:6333]
            mysqld.exe!mysql_execute_command()[sql_parse.cc:3364]
            mysqld.exe!mysql_parse()[sql_parse.cc:7759]
            mysqld.exe!dispatch_command()[sql_parse.cc:1796]
            mysqld.exe!do_command()[sql_parse.cc:1353]
            mysqld.exe!threadpool_process_request()[threadpool_common.cc:252]
            mysqld.exe!io_completion_callback()[threadpool_win.cc:462]
            KERNEL32.DLL!VirtualUnlock()
            ntdll.dll!RtlGetActiveActivationContext()
            ntdll.dll!RtlFreeUnicodeString()
            KERNEL32.DLL!BaseThreadInitThunk()
            ntdll.dll!RtlUserThreadStart()

            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7ac0796830): SELECT DISTINCT VAR_SAMP( 0 ) AS field1, 0 & `col_varchar_key` AS field2, DEFAULT( `pk` ) AS field3, VAR_SAMP( '03:45:21.036911' ) AS field4 FROM `d` WHERE UpdateXML( '2001-11-28 07:47:44.028941', 'babebcbbdd//cddedcccbcbecadeeedcabedbccd/babbbcdc/ca//dbcbb/d/a/bacaade/dcaabeedae/adb/e/edc/acb', 5386023679358402560 ) GROUP BY @A := ( LN( `col_datetime_key` ) ) WITH ROLLUP /* QUERY_NO 256 CON_ID 12 */
            Connection ID (thread ID): 12
            Status: NOT_KILLED
            {noformat}

            Looks similar to MDEV-10728, only this time it's not an assertion failure, but a crash (also on a debug build).
            http://buildbot.askmonty.org/buildbot/builders/win-rqg-se/builds/2677/steps/rqg_crash_tests/logs/stdio
            {noformat}
            160907 15:59:51 [ERROR] mysqld got exception 0xc0000005 ;
            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.2.2-MariaDB-debug-log
            key_buffer_size=1048576
            read_buffer_size=131072
            max_used_connections=7
            max_threads=1001
            thread_count=6
            It is possible that mysqld could use up to
            key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 388178 K bytes of memory
            Hope that's ok; if not, decrease some variables in the equation.

            Thread pointer: 0x0x7ac0725fb8
            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...
            mysqld.exe!MoveSmall()[memcpy.asm:253]
            mysqld.exe!create_tmp_table()[sql_select.cc:16663]
            mysqld.exe!JOIN::create_postjoin_aggr_table()[sql_select.cc:2717]
            mysqld.exe!JOIN::make_aggr_tables_info()[sql_select.cc:2408]
            mysqld.exe!JOIN::optimize_inner()[sql_select.cc:2077]
            mysqld.exe!JOIN::optimize()[sql_select.cc:1072]
            mysqld.exe!mysql_select()[sql_select.cc:3526]
            mysqld.exe!handle_select()[sql_select.cc:373]
            mysqld.exe!execute_sqlcom_select()[sql_parse.cc:6333]
            mysqld.exe!mysql_execute_command()[sql_parse.cc:3364]
            mysqld.exe!mysql_parse()[sql_parse.cc:7759]
            mysqld.exe!dispatch_command()[sql_parse.cc:1796]
            mysqld.exe!do_command()[sql_parse.cc:1353]
            mysqld.exe!threadpool_process_request()[threadpool_common.cc:252]
            mysqld.exe!io_completion_callback()[threadpool_win.cc:462]
            KERNEL32.DLL!VirtualUnlock()
            ntdll.dll!RtlGetActiveActivationContext()
            ntdll.dll!RtlFreeUnicodeString()
            KERNEL32.DLL!BaseThreadInitThunk()
            ntdll.dll!RtlUserThreadStart()

            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7ac0796830): SELECT DISTINCT VAR_SAMP( 0 ) AS field1, 0 & `col_varchar_key` AS field2, DEFAULT( `pk` ) AS field3, VAR_SAMP( '03:45:21.036911' ) AS field4 FROM `d` WHERE UpdateXML( '2001-11-28 07:47:44.028941', 'babebcbbdd//cddedcccbcbecadeeedcabedbccd/babbbcdc/ca//dbcbb/d/a/bacaade/dcaabeedae/adb/e/edc/acb', 5386023679358402560 ) GROUP BY @A := ( LN( `col_datetime_key` ) ) WITH ROLLUP /* QUERY_NO 256 CON_ID 12 */
            Connection ID (thread ID): 12
            Status: NOT_KILLED
            {noformat}

            Looks similar to MDEV-10556, only this time it's not an assertion failure, but a crash (also on a debug build).
            elenst Elena Stepanova made changes -
            Description http://buildbot.askmonty.org/buildbot/builders/win-rqg-se/builds/2677/steps/rqg_crash_tests/logs/stdio
            {noformat}
            160907 15:59:51 [ERROR] mysqld got exception 0xc0000005 ;
            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.2.2-MariaDB-debug-log
            key_buffer_size=1048576
            read_buffer_size=131072
            max_used_connections=7
            max_threads=1001
            thread_count=6
            It is possible that mysqld could use up to
            key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 388178 K bytes of memory
            Hope that's ok; if not, decrease some variables in the equation.

            Thread pointer: 0x0x7ac0725fb8
            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...
            mysqld.exe!MoveSmall()[memcpy.asm:253]
            mysqld.exe!create_tmp_table()[sql_select.cc:16663]
            mysqld.exe!JOIN::create_postjoin_aggr_table()[sql_select.cc:2717]
            mysqld.exe!JOIN::make_aggr_tables_info()[sql_select.cc:2408]
            mysqld.exe!JOIN::optimize_inner()[sql_select.cc:2077]
            mysqld.exe!JOIN::optimize()[sql_select.cc:1072]
            mysqld.exe!mysql_select()[sql_select.cc:3526]
            mysqld.exe!handle_select()[sql_select.cc:373]
            mysqld.exe!execute_sqlcom_select()[sql_parse.cc:6333]
            mysqld.exe!mysql_execute_command()[sql_parse.cc:3364]
            mysqld.exe!mysql_parse()[sql_parse.cc:7759]
            mysqld.exe!dispatch_command()[sql_parse.cc:1796]
            mysqld.exe!do_command()[sql_parse.cc:1353]
            mysqld.exe!threadpool_process_request()[threadpool_common.cc:252]
            mysqld.exe!io_completion_callback()[threadpool_win.cc:462]
            KERNEL32.DLL!VirtualUnlock()
            ntdll.dll!RtlGetActiveActivationContext()
            ntdll.dll!RtlFreeUnicodeString()
            KERNEL32.DLL!BaseThreadInitThunk()
            ntdll.dll!RtlUserThreadStart()

            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7ac0796830): SELECT DISTINCT VAR_SAMP( 0 ) AS field1, 0 & `col_varchar_key` AS field2, DEFAULT( `pk` ) AS field3, VAR_SAMP( '03:45:21.036911' ) AS field4 FROM `d` WHERE UpdateXML( '2001-11-28 07:47:44.028941', 'babebcbbdd//cddedcccbcbecadeeedcabedbccd/babbbcdc/ca//dbcbb/d/a/bacaade/dcaabeedae/adb/e/edc/acb', 5386023679358402560 ) GROUP BY @A := ( LN( `col_datetime_key` ) ) WITH ROLLUP /* QUERY_NO 256 CON_ID 12 */
            Connection ID (thread ID): 12
            Status: NOT_KILLED
            {noformat}

            Looks similar to MDEV-10556, only this time it's not an assertion failure, but a crash (also on a debug build).
            http://buildbot.askmonty.org/buildbot/builders/win-rqg-se/builds/2677/steps/rqg_crash_tests/logs/stdio
            {noformat}
            160907 15:59:51 [ERROR] mysqld got exception 0xc0000005 ;
            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.2.2-MariaDB-debug-log
            key_buffer_size=1048576
            read_buffer_size=131072
            max_used_connections=7
            max_threads=1001
            thread_count=6
            It is possible that mysqld could use up to
            key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 388178 K bytes of memory
            Hope that's ok; if not, decrease some variables in the equation.

            Thread pointer: 0x0x7ac0725fb8
            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...
            mysqld.exe!MoveSmall()[memcpy.asm:253]
            mysqld.exe!create_tmp_table()[sql_select.cc:16663]
            mysqld.exe!JOIN::create_postjoin_aggr_table()[sql_select.cc:2717]
            mysqld.exe!JOIN::make_aggr_tables_info()[sql_select.cc:2408]
            mysqld.exe!JOIN::optimize_inner()[sql_select.cc:2077]
            mysqld.exe!JOIN::optimize()[sql_select.cc:1072]
            mysqld.exe!mysql_select()[sql_select.cc:3526]
            mysqld.exe!handle_select()[sql_select.cc:373]
            mysqld.exe!execute_sqlcom_select()[sql_parse.cc:6333]
            mysqld.exe!mysql_execute_command()[sql_parse.cc:3364]
            mysqld.exe!mysql_parse()[sql_parse.cc:7759]
            mysqld.exe!dispatch_command()[sql_parse.cc:1796]
            mysqld.exe!do_command()[sql_parse.cc:1353]
            mysqld.exe!threadpool_process_request()[threadpool_common.cc:252]
            mysqld.exe!io_completion_callback()[threadpool_win.cc:462]
            KERNEL32.DLL!VirtualUnlock()
            ntdll.dll!RtlGetActiveActivationContext()
            ntdll.dll!RtlFreeUnicodeString()
            KERNEL32.DLL!BaseThreadInitThunk()
            ntdll.dll!RtlUserThreadStart()

            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7ac0796830): SELECT DISTINCT VAR_SAMP( 0 ) AS field1, 0 & `col_varchar_key` AS field2, DEFAULT( `pk` ) AS field3, VAR_SAMP( '03:45:21.036911' ) AS field4 FROM `d` WHERE UpdateXML( '2001-11-28 07:47:44.028941', 'babebcbbdd//cddedcccbcbecadeeedcabedbccd/babbbcdc/ca//dbcbb/d/a/bacaade/dcaabeedae/adb/e/edc/acb', 5386023679358402560 ) GROUP BY @A := ( LN( `col_datetime_key` ) ) WITH ROLLUP /* QUERY_NO 256 CON_ID 12 */
            Connection ID (thread ID): 12
            Status: NOT_KILLED
            {noformat}

            Looks similar to MDEV-10556, only this time it's not an assertion failure, but a crash (also on a debug build).

            The weird test case below triggers the problem with some decent probabilty, at least on my machine. I can't remove any single line from it, so it's some strange race condition. Also, it's only happening with MTR_VERSION=1

            {code:sql}
            --disable_query_log
            --disable_result_log

            --connect (con2,127.0.0.1,root,,test)
            --connect (con3,127.0.0.1,root,,test)
            CREATE TABLE D (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
            INSERT INTO D () VALUES
            (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
            (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
            (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
            (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
            (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),();

            CREATE TABLE DUMMY (i INT) ENGINE=InnoDB;
            INSERT INTO DUMMY VALUES(0);
            --disconnect con3
            --sleep 3

            --connect (con9,127.0.0.1,root,,test)
            SELECT * FROM information_schema.tables WHERE table_name <> 'DUMMY';
            SELECT COUNT(*) FROM INFORMATION_SCHEMA.ALL_PLUGINS;
            --disconnect con9

            --connect (con10,127.0.0.1,root,,test)
            --connect (con11,127.0.0.1,root,,test)
            --send
            SELECT * FROM D;

            --connect (con12,127.0.0.1,root,,test)
            SELECT DISTINCT DEFAULT( `pk` ) FROM `D` GROUP BY @A := 1 WITH ROLLUP;

            --connection con11
            --reap
            {code}

            Script to run it repeatedly (MTR1 does not support --repeat option):
            {noformat}
            for i in 1 2 3 4 5 6 7 8 9
            do
              MTR_VERSION=1 perl ./mtr main.t2
              if [ $? -gt 0 ] ; then
                cat var/log/master.err
                exit 1
              fi
            done
            {noformat}

            {noformat:title=Stack trace from 10.0 6c74ef8ae9}
            3 <signal handler called>
            #4 __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:166
            #5 0x00000000006a37fd in create_tmp_table (thd=0x7fbb58988070, param=0x7fbb44cb6f98, fields=..., group=0x0, distinct=false, save_sum_fields=true, select_options=2147748609, rows_limit=18446744073709551615, table_alias=0xe9b7ff "", do_not_open=false, keep_row_order=false) at /data/src/10.0/sql/sql_select.cc:16319
            #6 0x00000000006827e2 in JOIN::exec_inner (this=0x7fbb44c22050) at /data/src/10.0/sql/sql_select.cc:2756
            #7 0x0000000000681216 in JOIN::exec (this=0x7fbb44c22050) at /data/src/10.0/sql/sql_select.cc:2373
            #8 0x000000000068457e in mysql_select (thd=0x7fbb58988070, rref_pointer_array=0x7fbb5898c378, tables=0x7fbb44c21430, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, group=0x7fbb44c21f40, having=0x0, proc_param=0x0, select_options=2147748609, result=0x7fbb44c22030, unit=0x7fbb5898ba10, select_lex=0x7fbb5898c100) at /data/src/10.0/sql/sql_select.cc:3308
            #9 0x000000000067a93a in handle_select (thd=0x7fbb58988070, lex=0x7fbb5898b948, result=0x7fbb44c22030, setup_tables_done_option=0) at /data/src/10.0/sql/sql_select.cc:373
            #10 0x000000000064f197 in execute_sqlcom_select (thd=0x7fbb58988070, all_tables=0x7fbb44c21430) at /data/src/10.0/sql/sql_parse.cc:5294
            #11 0x00000000006476c2 in mysql_execute_command (thd=0x7fbb58988070) at /data/src/10.0/sql/sql_parse.cc:2563
            #12 0x0000000000651e18 in mysql_parse (thd=0x7fbb58988070, rawbuf=0x7fbb44c21088 "SELECT DISTINCT DEFAULT( `pk` ) FROM `D` GROUP BY @A := 1 WITH ROLLUP", length=69, parser_state=0x7fbb6aae66a0) at /data/src/10.0/sql/sql_parse.cc:6576
            #13 0x0000000000644918 in dispatch_command (command=COM_QUERY, thd=0x7fbb58988070, packet=0x7fbb58994071 "SELECT DISTINCT DEFAULT( `pk` ) FROM `D` GROUP BY @A := 1 WITH ROLLUP", packet_length=69) at /data/src/10.0/sql/sql_parse.cc:1309
            #14 0x0000000000643bdb in do_command (thd=0x7fbb58988070) at /data/src/10.0/sql/sql_parse.cc:999
            #15 0x0000000000761efa in do_handle_one_connection (thd_arg=0x7fbb58988070) at /data/src/10.0/sql/sql_connect.cc:1378
            #16 0x0000000000761c6c in handle_one_connection (arg=0x7fbb58988070) at /data/src/10.0/sql/sql_connect.cc:1293
            #17 0x00007fbb6a8650a4 in start_thread (arg=0x7fbb6aae7700) at pthread_create.c:309
            #18 0x00007fbb68a1d87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
            {noformat}
            All threads stack trace is attached as threads1.

            Reproducible on 10.0, 10.1, 10.2. Not sure if it's reproducible on 5.5 -- the test case does not work there because of {{ALL_PLUGINS}}.
            elenst Elena Stepanova made changes -
            Attachment threads1 [ 42508 ]
            elenst Elena Stepanova made changes -
            Affects Version/s 10.0 [ 16000 ]
            Affects Version/s 10.1 [ 16100 ]
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            Component/s Data Definition - Temporary [ 10123 ]
            Fix Version/s 10.0 [ 16000 ]
            Fix Version/s 10.1 [ 16100 ]
            Affects Version/s 10.2 [ 14601 ]
            Description http://buildbot.askmonty.org/buildbot/builders/win-rqg-se/builds/2677/steps/rqg_crash_tests/logs/stdio
            {noformat}
            160907 15:59:51 [ERROR] mysqld got exception 0xc0000005 ;
            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.2.2-MariaDB-debug-log
            key_buffer_size=1048576
            read_buffer_size=131072
            max_used_connections=7
            max_threads=1001
            thread_count=6
            It is possible that mysqld could use up to
            key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 388178 K bytes of memory
            Hope that's ok; if not, decrease some variables in the equation.

            Thread pointer: 0x0x7ac0725fb8
            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...
            mysqld.exe!MoveSmall()[memcpy.asm:253]
            mysqld.exe!create_tmp_table()[sql_select.cc:16663]
            mysqld.exe!JOIN::create_postjoin_aggr_table()[sql_select.cc:2717]
            mysqld.exe!JOIN::make_aggr_tables_info()[sql_select.cc:2408]
            mysqld.exe!JOIN::optimize_inner()[sql_select.cc:2077]
            mysqld.exe!JOIN::optimize()[sql_select.cc:1072]
            mysqld.exe!mysql_select()[sql_select.cc:3526]
            mysqld.exe!handle_select()[sql_select.cc:373]
            mysqld.exe!execute_sqlcom_select()[sql_parse.cc:6333]
            mysqld.exe!mysql_execute_command()[sql_parse.cc:3364]
            mysqld.exe!mysql_parse()[sql_parse.cc:7759]
            mysqld.exe!dispatch_command()[sql_parse.cc:1796]
            mysqld.exe!do_command()[sql_parse.cc:1353]
            mysqld.exe!threadpool_process_request()[threadpool_common.cc:252]
            mysqld.exe!io_completion_callback()[threadpool_win.cc:462]
            KERNEL32.DLL!VirtualUnlock()
            ntdll.dll!RtlGetActiveActivationContext()
            ntdll.dll!RtlFreeUnicodeString()
            KERNEL32.DLL!BaseThreadInitThunk()
            ntdll.dll!RtlUserThreadStart()

            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7ac0796830): SELECT DISTINCT VAR_SAMP( 0 ) AS field1, 0 & `col_varchar_key` AS field2, DEFAULT( `pk` ) AS field3, VAR_SAMP( '03:45:21.036911' ) AS field4 FROM `d` WHERE UpdateXML( '2001-11-28 07:47:44.028941', 'babebcbbdd//cddedcccbcbecadeeedcabedbccd/babbbcdc/ca//dbcbb/d/a/bacaade/dcaabeedae/adb/e/edc/acb', 5386023679358402560 ) GROUP BY @A := ( LN( `col_datetime_key` ) ) WITH ROLLUP /* QUERY_NO 256 CON_ID 12 */
            Connection ID (thread ID): 12
            Status: NOT_KILLED
            {noformat}

            Looks similar to MDEV-10556, only this time it's not an assertion failure, but a crash (also on a debug build).

            The weird test case below triggers the problem with some decent probabilty, at least on my machine. I can't remove any single line from it, so it's some strange race condition. Also, it's only happening with MTR_VERSION=1

            {code:sql}
            --disable_query_log
            --disable_result_log

            --connect (con2,127.0.0.1,root,,test)
            --connect (con3,127.0.0.1,root,,test)
            CREATE TABLE D (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
            INSERT INTO D () VALUES
            (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
            (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
            (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
            (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
            (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),();

            CREATE TABLE DUMMY (i INT) ENGINE=InnoDB;
            INSERT INTO DUMMY VALUES(0);
            --disconnect con3
            --sleep 3

            --connect (con9,127.0.0.1,root,,test)
            SELECT * FROM information_schema.tables WHERE table_name <> 'DUMMY';
            SELECT COUNT(*) FROM INFORMATION_SCHEMA.ALL_PLUGINS;
            --disconnect con9

            --connect (con10,127.0.0.1,root,,test)
            --connect (con11,127.0.0.1,root,,test)
            --send
            SELECT * FROM D;

            --connect (con12,127.0.0.1,root,,test)
            SELECT DISTINCT DEFAULT( `pk` ) FROM `D` GROUP BY @A := 1 WITH ROLLUP;

            --connection con11
            --reap
            {code}

            Script to run it repeatedly (MTR1 does not support --repeat option):
            {noformat}
            for i in 1 2 3 4 5 6 7 8 9
            do
              MTR_VERSION=1 perl ./mtr main.t2
              if [ $? -gt 0 ] ; then
                cat var/log/master.err
                exit 1
              fi
            done
            {noformat}

            {noformat:title=Stack trace from 10.0 6c74ef8ae9}
            3 <signal handler called>
            #4 __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:166
            #5 0x00000000006a37fd in create_tmp_table (thd=0x7fbb58988070, param=0x7fbb44cb6f98, fields=..., group=0x0, distinct=false, save_sum_fields=true, select_options=2147748609, rows_limit=18446744073709551615, table_alias=0xe9b7ff "", do_not_open=false, keep_row_order=false) at /data/src/10.0/sql/sql_select.cc:16319
            #6 0x00000000006827e2 in JOIN::exec_inner (this=0x7fbb44c22050) at /data/src/10.0/sql/sql_select.cc:2756
            #7 0x0000000000681216 in JOIN::exec (this=0x7fbb44c22050) at /data/src/10.0/sql/sql_select.cc:2373
            #8 0x000000000068457e in mysql_select (thd=0x7fbb58988070, rref_pointer_array=0x7fbb5898c378, tables=0x7fbb44c21430, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, group=0x7fbb44c21f40, having=0x0, proc_param=0x0, select_options=2147748609, result=0x7fbb44c22030, unit=0x7fbb5898ba10, select_lex=0x7fbb5898c100) at /data/src/10.0/sql/sql_select.cc:3308
            #9 0x000000000067a93a in handle_select (thd=0x7fbb58988070, lex=0x7fbb5898b948, result=0x7fbb44c22030, setup_tables_done_option=0) at /data/src/10.0/sql/sql_select.cc:373
            #10 0x000000000064f197 in execute_sqlcom_select (thd=0x7fbb58988070, all_tables=0x7fbb44c21430) at /data/src/10.0/sql/sql_parse.cc:5294
            #11 0x00000000006476c2 in mysql_execute_command (thd=0x7fbb58988070) at /data/src/10.0/sql/sql_parse.cc:2563
            #12 0x0000000000651e18 in mysql_parse (thd=0x7fbb58988070, rawbuf=0x7fbb44c21088 "SELECT DISTINCT DEFAULT( `pk` ) FROM `D` GROUP BY @A := 1 WITH ROLLUP", length=69, parser_state=0x7fbb6aae66a0) at /data/src/10.0/sql/sql_parse.cc:6576
            #13 0x0000000000644918 in dispatch_command (command=COM_QUERY, thd=0x7fbb58988070, packet=0x7fbb58994071 "SELECT DISTINCT DEFAULT( `pk` ) FROM `D` GROUP BY @A := 1 WITH ROLLUP", packet_length=69) at /data/src/10.0/sql/sql_parse.cc:1309
            #14 0x0000000000643bdb in do_command (thd=0x7fbb58988070) at /data/src/10.0/sql/sql_parse.cc:999
            #15 0x0000000000761efa in do_handle_one_connection (thd_arg=0x7fbb58988070) at /data/src/10.0/sql/sql_connect.cc:1378
            #16 0x0000000000761c6c in handle_one_connection (arg=0x7fbb58988070) at /data/src/10.0/sql/sql_connect.cc:1293
            #17 0x00007fbb6a8650a4 in start_thread (arg=0x7fbb6aae7700) at pthread_create.c:309
            #18 0x00007fbb68a1d87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
            {noformat}
            All threads stack trace is attached as threads1.

            Reproducible on 10.0, 10.1, 10.2. Not sure if it's reproducible on 5.5 -- the test case does not work there because of {{ALL_PLUGINS}}.
            {noformat:title=Stack trace from 10.0 b34d7fba31}
            #3 <signal handler called>
            #4 __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:166
            #5 0x00000000006a37fd in create_tmp_table (thd=0x7fce94aa1070, param=0x7fce9282ef98, fields=..., group=0x0, distinct=false, save_sum_fields=true, select_options=2147748609, rows_limit=18446744073709551615, table_alias=0xe9b7ff "", do_not_open=false, keep_row_order=false) at /data/src/10.0/sql/sql_select.cc:16319
            #6 0x00000000006827e2 in JOIN::exec_inner (this=0x7fce92825048) at /data/src/10.0/sql/sql_select.cc:2756
            #7 0x0000000000681216 in JOIN::exec (this=0x7fce92825048) at /data/src/10.0/sql/sql_select.cc:2373
            #8 0x000000000068457e in mysql_select (thd=0x7fce94aa1070, rref_pointer_array=0x7fce94aa5378, tables=0x7fce92824428, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, group=0x7fce92824f38, having=0x0, proc_param=0x0, select_options=2147748609, result=0x7fce92825028, unit=0x7fce94aa4a10, select_lex=0x7fce94aa5100) at /data/src/10.0/sql/sql_select.cc:3308
            #9 0x000000000067a93a in handle_select (thd=0x7fce94aa1070, lex=0x7fce94aa4948, result=0x7fce92825028, setup_tables_done_option=0) at /data/src/10.0/sql/sql_select.cc:373
            #10 0x000000000064f197 in execute_sqlcom_select (thd=0x7fce94aa1070, all_tables=0x7fce92824428) at /data/src/10.0/sql/sql_parse.cc:5294
            #11 0x00000000006476c2 in mysql_execute_command (thd=0x7fce94aa1070) at /data/src/10.0/sql/sql_parse.cc:2563
            #12 0x0000000000651e18 in mysql_parse (thd=0x7fce94aa1070, rawbuf=0x7fce92824088 "SELECT DISTINCT DEFAULT( `pk` ) FROM t1 GROUP BY @A := 1 WITH ROLLUP", length=68, parser_state=0x7fce9cc2c650) at /data/src/10.0/sql/sql_parse.cc:6576
            #13 0x0000000000644918 in dispatch_command (command=COM_QUERY, thd=0x7fce94aa1070, packet=0x7fce94aa7071 "SELECT DISTINCT DEFAULT( `pk` ) FROM t1 GROUP BY @A := 1 WITH ROLLUP", packet_length=68) at /data/src/10.0/sql/sql_parse.cc:1309
            #14 0x0000000000643bdb in do_command (thd=0x7fce94aa1070) at /data/src/10.0/sql/sql_parse.cc:999
            #15 0x0000000000761efa in do_handle_one_connection (thd_arg=0x7fce94aa1070) at /data/src/10.0/sql/sql_connect.cc:1378
            #16 0x0000000000761c6c in handle_one_connection (arg=0x7fce94aa1070) at /data/src/10.0/sql/sql_connect.cc:1293
            #17 0x00000000009faa88 in pfs_spawn_thread (arg=0x7fce9498fa70) at /data/src/10.0/storage/perfschema/pfs.cc:1860
            #18 0x00007fce9c8b20a4 in start_thread (arg=0x7fce9cc2d700) at pthread_create.c:309
            #19 0x00007fce9aa6a87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
            {noformat}

            {code:sql|title=MTR test (run with --repeat=N)}
            DROP TABLE IF EXISTS t1;

            CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=MyISAM;
            INSERT INTO t1 () VALUES
            (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
            (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
            (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
            (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
            (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),();

            --connect (con1,127.0.0.1,root,,test)
            --send
            SELECT * FROM t1;

            --connect (con2,127.0.0.1,root,,test)
            SELECT DISTINCT DEFAULT( `pk` ) FROM t1 GROUP BY @A := 1 WITH ROLLUP;

            --connection con1
            --reap

            --disconnect con1
            --disconnect con2

            --connection default
            DROP TABLE t1;
            {code}

            Reproducible on 10.0, 10.1.
            Not reproducible on 5.5.
            Not reproducible with this test on 10.2, but see MDEV-10806.
            Summary [Draft] Crash in create_tmp_table()[sql_select.cc:16663] Server crashes in in create_tmp_table
            elenst Elena Stepanova made changes -
            Assignee Elena Stepanova [ elenst ] Vladislav Vaintroub [ wlad ]
            wlad Vladislav Vaintroub made changes -
            Sprint 10.1.18 [ 98 ]
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            bar Alexander Barkov made changes -
            Assignee Vladislav Vaintroub [ wlad ] Alexander Barkov [ bar ]
            bar Alexander Barkov made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            bar Alexander Barkov made changes -
            Assignee Alexander Barkov [ bar ] Oleksandr Byelkin [ sanja ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            bar Alexander Barkov made changes -
            issue.field.resolutiondate 2016-11-10 14:20:17.0 2016-11-10 14:20:17.71
            bar Alexander Barkov made changes -
            Fix Version/s 10.0.29 [ 22312 ]
            Fix Version/s 10.0 [ 16000 ]
            Fix Version/s 10.1 [ 16100 ]
            Resolution Fixed [ 1 ]
            Status In Review [ 10002 ] Closed [ 6 ]
            bar Alexander Barkov made changes -
            Assignee Oleksandr Byelkin [ sanja ] Alexander Barkov [ bar ]
            bar Alexander Barkov made changes -
            Fix Version/s 10.1.20 [ 22112 ]
            Fix Version/s 10.2.3 [ 22115 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 77020 ] MariaDB v4 [ 150897 ]

            People

              bar Alexander Barkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.