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

Server crashes in pushdown_cond_for_derived

Details

    Description

      Stack trace from 10.2 1168e2fa54

      #3  <signal handler called>
      #4  0x00007fe1f5c0996d in pushdown_cond_for_derived (thd=0x7fe1ea416070, cond=0x7fe1ea469e50, derived=0x7fe1ea465588) at /data/src/10.2/sql/sql_derived.cc:1182
      #5  0x00007fe1f5c72c71 in JOIN::optimize_inner (this=0x7fe1ea467b28) at /data/src/10.2/sql/sql_select.cc:1264
      #6  0x00007fe1f5c72344 in JOIN::optimize (this=0x7fe1ea467b28) at /data/src/10.2/sql/sql_select.cc:1076
      #7  0x00007fe1f5c7a798 in mysql_select (thd=0x7fe1ea416070, tables=0x7fe1ea464298, wild_num=1, fields=..., conds=0x7fe1ea465ba8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fe1ea467b08, unit=0x7fe1ea419b18, select_lex=0x7fe1ea41a250) at /data/src/10.2/sql/sql_select.cc:3535
      #8  0x00007fe1f5c6fea1 in handle_select (thd=0x7fe1ea416070, lex=0x7fe1ea419a50, result=0x7fe1ea467b08, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:373
      #9  0x00007fe1f5c3f938 in execute_sqlcom_select (thd=0x7fe1ea416070, all_tables=0x7fe1ea464298) at /data/src/10.2/sql/sql_parse.cc:6345
      #10 0x00007fe1f5c3576e in mysql_execute_command (thd=0x7fe1ea416070) at /data/src/10.2/sql/sql_parse.cc:3376
      #11 0x00007fe1f5c430d7 in mysql_parse (thd=0x7fe1ea416070, rawbuf=0x7fe1ea464088 "SELECT * FROM t WHERE 1 IN ( SELECT * FROM v )", length=46, parser_state=0x7fe1f6b91dd0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7774
      #12 0x00007fe1f5c314c5 in dispatch_command (command=COM_QUERY, thd=0x7fe1ea416070, packet=0x7fe1ea458071 "SELECT * FROM t WHERE 1 IN ( SELECT * FROM v )", packet_length=46, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1805
      #13 0x00007fe1f5c2fef6 in do_command (thd=0x7fe1ea416070) at /data/src/10.2/sql/sql_parse.cc:1365
      #14 0x00007fe1f5d6b7ba in do_handle_one_connection (connect=0x7fe1f286d410) at /data/src/10.2/sql/sql_connect.cc:1354
      #15 0x00007fe1f5d6b547 in handle_one_connection (arg=0x7fe1f286d410) at /data/src/10.2/sql/sql_connect.cc:1260
      #16 0x00007fe1f6079b26 in pfs_spawn_thread (arg=0x7fe1f28519f0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #17 0x00007fe1f52b40a4 in start_thread (arg=0x7fe1f6b93300) at pthread_create.c:309
      #18 0x00007fe1f346c87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      CREATE TABLE t (i INT) ENGINE=MyISAM;
      CREATE VIEW v AS SELECT 5;
      SELECT * FROM t WHERE 1 IN ( SELECT * FROM v );
      

      The problem started happening after recent merges, but I can't point at the exact commit which caused it.

      Attachments

        Activity

          elenst Elena Stepanova created issue -
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          Component/s Optimizer [ 10200 ]
          Fix Version/s 10.2 [ 14601 ]
          Assignee Elena Stepanova [ elenst ] Oleksandr Byelkin [ sanja ]
          Description http://buildbot.askmonty.org/buildbot/builders/win-rqg-se/builds/2679/steps/rqg_crash_tests/logs/stdio
          {noformat}
          160908 7:26:57 [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 = 388182 K bytes of memory
          Hope that's ok; if not, decrease some variables in the equation.

          Thread pointer: 0x0xf0cd16ba58
          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!pushdown_cond_for_derived()[sql_derived.cc:1186]
          mysqld.exe!JOIN::optimize_inner()[sql_select.cc:1277]
          mysqld.exe!JOIN::optimize()[sql_select.cc:1072]
          mysqld.exe!mysql_select()[sql_select.cc:3547]
          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 (0xf0c1c8bde0): SELECT alias1.`col_varchar_key` AS field1 FROM ( `c` AS alias1, `d` AS alias2 ) WHERE ( 1 IN ( SELECT * FROM view_2676_inline_0 ) ) AND alias1.`col_int_key` = 201 AND ( alias1.`col_varchar_key` = 'x' AND alias1.`col_varchar_key` > 'v' AND alias2.`col_date_nokey` <= alias2.`col_time_key` ) GROUP BY field1 ORDER BY field1 LIMIT 2 OFFSET 5 /* QUERY_NO 1024 CON_ID 13 */ /* TRANSFORM_OUTCOME_UNORDERED_MATCH */ /* QUERY_NO 1028 CON_ID 13 */
          Connection ID (thread ID): 13
          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=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off,condition_pushdown_for_derived=on
          {noformat}
          {noformat:title=Stack trace from 10.2 1168e2fa54}
          #3 <signal handler called>
          #4 0x00007fe1f5c0996d in pushdown_cond_for_derived (thd=0x7fe1ea416070, cond=0x7fe1ea469e50, derived=0x7fe1ea465588) at /data/src/10.2/sql/sql_derived.cc:1182
          #5 0x00007fe1f5c72c71 in JOIN::optimize_inner (this=0x7fe1ea467b28) at /data/src/10.2/sql/sql_select.cc:1264
          #6 0x00007fe1f5c72344 in JOIN::optimize (this=0x7fe1ea467b28) at /data/src/10.2/sql/sql_select.cc:1076
          #7 0x00007fe1f5c7a798 in mysql_select (thd=0x7fe1ea416070, tables=0x7fe1ea464298, wild_num=1, fields=..., conds=0x7fe1ea465ba8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fe1ea467b08, unit=0x7fe1ea419b18, select_lex=0x7fe1ea41a250) at /data/src/10.2/sql/sql_select.cc:3535
          #8 0x00007fe1f5c6fea1 in handle_select (thd=0x7fe1ea416070, lex=0x7fe1ea419a50, result=0x7fe1ea467b08, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:373
          #9 0x00007fe1f5c3f938 in execute_sqlcom_select (thd=0x7fe1ea416070, all_tables=0x7fe1ea464298) at /data/src/10.2/sql/sql_parse.cc:6345
          #10 0x00007fe1f5c3576e in mysql_execute_command (thd=0x7fe1ea416070) at /data/src/10.2/sql/sql_parse.cc:3376
          #11 0x00007fe1f5c430d7 in mysql_parse (thd=0x7fe1ea416070, rawbuf=0x7fe1ea464088 "SELECT * FROM t WHERE 1 IN ( SELECT * FROM v )", length=46, parser_state=0x7fe1f6b91dd0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7774
          #12 0x00007fe1f5c314c5 in dispatch_command (command=COM_QUERY, thd=0x7fe1ea416070, packet=0x7fe1ea458071 "SELECT * FROM t WHERE 1 IN ( SELECT * FROM v )", packet_length=46, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1805
          #13 0x00007fe1f5c2fef6 in do_command (thd=0x7fe1ea416070) at /data/src/10.2/sql/sql_parse.cc:1365
          #14 0x00007fe1f5d6b7ba in do_handle_one_connection (connect=0x7fe1f286d410) at /data/src/10.2/sql/sql_connect.cc:1354
          #15 0x00007fe1f5d6b547 in handle_one_connection (arg=0x7fe1f286d410) at /data/src/10.2/sql/sql_connect.cc:1260
          #16 0x00007fe1f6079b26 in pfs_spawn_thread (arg=0x7fe1f28519f0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
          #17 0x00007fe1f52b40a4 in start_thread (arg=0x7fe1f6b93300) at pthread_create.c:309
          #18 0x00007fe1f346c87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
          {noformat}

          {code:sql}
          CREATE TABLE t (i INT) ENGINE=MyISAM;
          CREATE VIEW v AS SELECT 5;
          SELECT * FROM t WHERE 1 IN ( SELECT * FROM v );
          {code}

          _The problem started happening after recent merges, but I can't point at the exact commit which caused it._
          Labels regression-10.2
          Summary [Draft] Server crashes in pushdown_cond_for_derived Server crashes in pushdown_cond_for_derived
          sanja Oleksandr Byelkin made changes -
          Status Open [ 1 ] In Progress [ 3 ]

          It looks like problem with connecting SELECTs/UNITs.

          For now it meet upper SELECT without JOIN. Taking into account how SELECTs optimizing it should not be possible...

          sanja Oleksandr Byelkin added a comment - It looks like problem with connecting SELECTs/UNITs. For now it meet upper SELECT without JOIN. Taking into account how SELECTs optimizing it should not be possible...

          Structure is correct. and it is pushing down. and it trying to push in SELECT which has no JOIN... (SELECT is simple maybe just removed or materialized?)

          sanja Oleksandr Byelkin added a comment - Structure is correct. and it is pushing down. and it trying to push in SELECT which has no JOIN... (SELECT is simple maybe just removed or materialized?)

          The view is already materialized and cleaned up, that is why it is has no JOIN and that is why it is too late something pushdown in it.

          sanja Oleksandr Byelkin added a comment - The view is already materialized and cleaned up, that is why it is has no JOIN and that is why it is too late something pushdown in it.
          sanja Oleksandr Byelkin made changes -
          Status In Progress [ 3 ] Stalled [ 10000 ]

          will discuss with igor how better to detect situation.

          sanja Oleksandr Byelkin added a comment - will discuss with igor how better to detect situation.
          sanja Oleksandr Byelkin made changes -
          Assignee Oleksandr Byelkin [ sanja ] Igor Babaev [ igor ]

          The fix for this bug was pushed into the 10.2 tree.

          igor Igor Babaev (Inactive) added a comment - The fix for this bug was pushed into the 10.2 tree.
          igor Igor Babaev (Inactive) made changes -
          Fix Version/s 10.2.2 [ 22013 ]
          Fix Version/s 10.2 [ 14601 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 77023 ] MariaDB v4 [ 150900 ]

          People

            igor Igor Babaev (Inactive)
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.