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

LP:523593 - Running RQG optimizer_no_subquery crashes MariaDB

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Running RQG optimizer_no_subquery crashes MariaDB. The crash happens on Linux 64-bit and Mac OS X Intel 64-bit. However, the crash does not happen with MySQL sources on the same machines with the same compile script. I attached the full stack trace from a Linux run.

      How to repeat

      • Get latest Random Query Generator from lp:randgen
      • Get latest MariaDB from lp:maria
        I tested with revno: 2818, timestamp: Wed 2010-02-17 21:10:02 +0100
      • Compile MariaDB with BUILD/compile-amd64-max
      • Run the RQG test like

      perl runall.pl \
      --basedir=$

      {HOME}

      /work/monty_program/maria \
      --engine=InnoDB \
      --grammar=conf/optimizer_no_subquery.yy \
      --queries=100000000 \
      --threads=1 \
      --duration=86400

      Stack trace on Linux:
      thd: 0x7fd9489089f0
      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 = 0x7fd937a22100 thread_stack 0x48000
      /home/hakan/work/monty_program/maria/sql/mysqld(my_print_stacktrace+0x35)[0x9e9cb5]
      /home/hakan/work/monty_program/maria/sql/mysqld(handle_segfault+0x331)[0x618981]
      /lib64/libpthread.so.0[0x7fd95b630a90]
      /home/hakan/work/monty_program/maria/sql/mysqld[0x79a5d2]
      /home/hakan/work/monty_program/maria/sql/mysqld[0x79ad69]
      /home/hakan/work/monty_program/maria/sql/mysqld[0x79b07b]
      /home/hakan/work/monty_program/maria/sql/mysqld[0x68a79a]
      /home/hakan/work/monty_program/maria/sql/mysqld(_ZN4JOIN8optimizeEv+0x56b)[0x68c95b]
      /home/hakan/work/monty_program/maria/sql/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x94)[0x6950f4]
      /home/hakan/work/monty_program/maria/sql/mysqld(_Z13handle_selectP3THDP6st_lexP13select_resultm+0x171)[0x695c01]
      /home/hakan/work/monty_program/maria/sql/mysqld[0x626559]
      /home/hakan/work/monty_program/maria/sql/mysqld(_Z21mysql_execute_commandP3THD+0x1da0)[0x62b000]
      /home/hakan/work/monty_program/maria/sql/mysqld(Z11mysql_parseP3THDPKcjPS2+0x3b1)[0x62ee91]
      /home/hakan/work/monty_program/maria/sql/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xe59)[0x62fcf9]
      /home/hakan/work/monty_program/maria/sql/mysqld(_Z10do_commandP3THD+0xee)[0x63056e]
      /home/hakan/work/monty_program/maria/sql/mysqld(handle_one_connection+0x1b9)[0x6221c9]
      /lib64/libpthread.so.0[0x7fd95b629070]
      /lib64/libc.so.6(clone+0x6d)[0x7fd95a6cf11d]

      Stack trace on Mac OS X:
      0 mysqld 0x00000001004f7829 my_print_stacktrace + 57
      1 mysqld 0x00000001000f24c2 handle_segfault + 802
      2 libSystem.B.dylib 0x00007fff86eaaeaa _sigtramp + 26
      3 ??? 0x0000000000000001 0x0 + 1
      4 mysqld 0x0000000100288b1a _ZL21check_func_dependencyP4JOINyP13List_iteratorI10TABLE_LISTEPS2_P4Item + 538
      5 mysqld 0x00000001002894b4 _ZL25eliminate_tables_for_listP4JOINP4ListI10TABLE_LISTEyP4Itemy + 340
      6 mysqld 0x0000000100171fd1 _ZL20make_join_statisticsP4JOINP10TABLE_LISTP4ItemP16st_dynamic_array + 2497
      7 mysqld 0x0000000100173e3e _ZN4JOIN8optimizeEv + 1374
      8 mysqld 0x000000010017da54 _Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex + 148
      9 mysqld 0x000000010017e572 _Z13handle_selectP3THDP6st_lexP13select_resultm + 370
      10 mysqld 0x0000000100100383 _ZL21execute_sqlcom_selectP3THDP10TABLE_LIST + 179
      11 mysqld 0x00000001001062d5 _Z21mysql_execute_commandP3THD + 8293
      12 mysqld 0x000000010010b048 Z11mysql_parseP3THDPKcjPS2 + 536
      13 mysqld 0x000000010010bbe1 _Z16dispatch_command19enum_server_commandP3THDPcj + 2961
      14 mysqld 0x000000010010c813 _Z10do_commandP3THD + 243
      15 mysqld 0x00000001000fcdae handle_one_connection + 302
      16 libSystem.B.dylib 0x00007fff86e83f8e _pthread_start + 331
      17 libSystem.B.dylib 0x00007fff86e83e41 thread_start + 13

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            psergey Sergei Petrunia added a comment -

            Ok, there is a repeatable single-query scenario:

            One needs to load the attached dataset, then run this query:

            SELECT table2 . `col_int_key` AS field1
            FROM (
            CC AS table1
            RIGHT OUTER JOIN
            (
            ( C AS table2 STRAIGHT_JOIN
            C AS table3 ON (
            (table3.col_varchar_nokey = table2.col_varchar_key ) AND
            (table3.pk = table2.col_int_key))
            )
            ) ON
            (
            (table3.col_varchar_key = table2.col_varchar_key) OR
            (table3.col_int_key = table2.pk)
            )
            )
            HAVING field1 < 216;
            Test dataset
            LPexportBug523593_bug523593.sql.gz

            Show
            psergey Sergei Petrunia added a comment - Ok, there is a repeatable single-query scenario: One needs to load the attached dataset, then run this query: SELECT table2 . `col_int_key` AS field1 FROM ( CC AS table1 RIGHT OUTER JOIN ( ( C AS table2 STRAIGHT_JOIN C AS table3 ON ( (table3.col_varchar_nokey = table2.col_varchar_key ) AND (table3.pk = table2.col_int_key)) ) ) ON ( (table3.col_varchar_key = table2.col_varchar_key) OR (table3.col_int_key = table2.pk) ) ) HAVING field1 < 216; Test dataset LPexportBug523593_bug523593.sql.gz
            Hide
            psergey Sergei Petrunia added a comment -

            Re: Running RQG optimizer_no_subquery crashes MariaDB
            Ok, there is a repeatable single-query scenario:

            One needs to load the attached dataset, then run this query:

            SELECT table2 . `col_int_key` AS field1
            FROM (
            CC AS table1
            RIGHT OUTER JOIN
            (
            ( C AS table2 STRAIGHT_JOIN
            C AS table3 ON (
            (table3.col_varchar_nokey = table2.col_varchar_key ) AND
            (table3.pk = table2.col_int_key))
            )
            ) ON
            (
            (table3.col_varchar_key = table2.col_varchar_key) OR
            (table3.col_int_key = table2.pk)
            )
            )
            HAVING field1 < 216;

            Show
            psergey Sergei Petrunia added a comment - Re: Running RQG optimizer_no_subquery crashes MariaDB Ok, there is a repeatable single-query scenario: One needs to load the attached dataset, then run this query: SELECT table2 . `col_int_key` AS field1 FROM ( CC AS table1 RIGHT OUTER JOIN ( ( C AS table2 STRAIGHT_JOIN C AS table3 ON ( (table3.col_varchar_nokey = table2.col_varchar_key ) AND (table3.pk = table2.col_int_key)) ) ) ON ( (table3.col_varchar_key = table2.col_varchar_key) OR (table3.col_int_key = table2.pk) ) ) HAVING field1 < 216;
            Hide
            psergey Sergei Petrunia added a comment -

            Re: Running RQG optimizer_no_subquery crashes MariaDB
            Please review: https://lists.launchpad.net/maria-developers/msg02202.html

            Show
            psergey Sergei Petrunia added a comment - Re: Running RQG optimizer_no_subquery crashes MariaDB Please review: https://lists.launchpad.net/maria-developers/msg02202.html
            Hide
            psergey Sergei Petrunia added a comment -

            Re: Running RQG optimizer_no_subquery crashes MariaDB
            The fix was pushed into 5.2 some time ago

            Show
            psergey Sergei Petrunia added a comment - Re: Running RQG optimizer_no_subquery crashes MariaDB The fix was pushed into 5.2 some time ago
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 523593

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 523593

              People

              • Assignee:
                psergey Sergei Petrunia
                Reporter:
                hakanküçükyılmaz Hakan Küçükyılmaz
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: