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

(Debug) crash in Dep_analysis_context::dbug_print_deps eq_mod->expr==0 (main.select)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Stalled (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.5, 10.0, 10.2.3, 10.3, 10.1
    • Fix Version/s: 10.2, 10.3, 10.4
    • Component/s: Optimizer
    • Labels:
    • Environment:
      fc27 x86_64
      gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)

      Description

      CMakeBuildType=Debug -DEXTRA_DEBUG=1

       $ mysql-test/mysql-test-run --mem --gdb --mysqld=-\#  main.select
      

      Took a fair while until the SEGV occurred.

      "10.3 85ddd9e8ce11bef089ccc6c86745142d09639c14"

      (gdb) break my_end
      Breakpoint 1 at 0x10c12dc: file /home/dan/software_projects/mariadb-server/mysys/my_init.c, line 133.
      (gdb) run
      Starting program: /home/dan/software_projects/build-mariadb-10.3-debug/sql/mysqld --defaults-group-suffix=.1 --defaults-file=/home/dan/software_projects/build-mariadb-10.3-debug/mysql-test/var/my.cnf --log-output=file --gdb -# --core-file --loose-debug-sync-timeout=300 
      [Thread debugging using libthread_db enabled]
      Using host libthread_db library "/lib64/libthread_db.so.1".
      Missing separate debuginfo for /lib64/liblz4.so.1
      ...
      2018-03-18 16:14:11 0 [Note] /home/dan/software_projects/build-mariadb-10.3-debug/sql/mysqld (mysqld 10.3.6-MariaDB-debug-log) starting as process 18223 ...
      2018-03-18 16:14:11 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 4162)
      [New Thread 0x7ffff46a5700 (LWP 18227)]
      [New Thread 0x7ffff33c7700 (LWP 18228)]
      [New Thread 0x7ffff7e54700 (LWP 18229)]
      [New Thread 0x7ffff2bc6700 (LWP 18230)]
      [New Thread 0x7ffff2b7b700 (LWP 18233)]
       
      Thread 6 "mysqld" received signal SIGSEGV, Segmentation fault.
      [Switching to Thread 0x7ffff2b7b700 (LWP 18233)]
      0x0000555555d8df1a in Dep_analysis_context::dbug_print_deps (
          this=0x7ffff2b78b20)
          at /home/dan/software_projects/mariadb-server/sql/opt_table_elimination.cc:1841
      1841        eq_mod->expr->print(&str, QT_ORDINARY);
      (gdb) bt
      #0  0x0000555555d8df1a in Dep_analysis_context::dbug_print_deps (
          this=0x7ffff2b78b20)
          at /home/dan/software_projects/mariadb-server/sql/opt_table_elimination.cc:1841
      #1  0x0000555555d8bc91 in check_func_dependency (join=0x7fffe001a350, 
          dep_tables=12, it=0x7ffff2b78de0, oj_tbl=0x0, cond=0x7fffe001a920)
          at /home/dan/software_projects/mariadb-server/sql/opt_table_elimination.cc:863
      #2  0x0000555555d8b905 in eliminate_tables_for_list (join=0x7fffe001a350, 
          join_list=0x7fffe00189c8, list_tables=12, on_expr=0x7fffe001a920, 
          tables_used_elsewhere=3)
          at /home/dan/software_projects/mariadb-server/sql/opt_table_elimination.cc:773
      #3  0x0000555555d8b74c in eliminate_tables_for_list (join=0x7fffe001a350, 
          join_list=0x7fffe0005318, list_tables=15, on_expr=0x0, 
          tables_used_elsewhere=3)
          at /home/dan/software_projects/mariadb-server/sql/opt_table_elimination.cc:733
      #4  0x0000555555d8b626 in eliminate_tables (join=0x7fffe001a350)
          at /home/dan/software_projects/mariadb-server/sql/opt_table_elimination.cc:671
      #5  0x0000555555c20c00 in make_join_statistics (join=0x7fffe001a350, 
          tables_list=..., keyuse_array=0x7fffe001a640)
      ---Type <return> to continue, or q <return> to quit---
          at /home/dan/software_projects/mariadb-server/sql/sql_select.cc:4496
      #6  0x0000555555c17b2b in JOIN::optimize_inner (this=0x7fffe001a350)
          at /home/dan/software_projects/mariadb-server/sql/sql_select.cc:1882
      #7  0x0000555555c16441 in JOIN::optimize (this=0x7fffe001a350)
          at /home/dan/software_projects/mariadb-server/sql/sql_select.cc:1467
      #8  0x0000555555c1fae8 in mysql_select (thd=0x7fffe0000d60, 
          tables=0x7fffe0015360, wild_num=0, fields=..., conds=0x0, og_num=2, 
          order=0x0, group=0x7fffe001a038, having=0x0, proc_param=0x0, 
          select_options=2147748608, result=0x7fffe001a330, unit=0x7fffe0004a00, 
          select_lex=0x7fffe0005178)
          at /home/dan/software_projects/mariadb-server/sql/sql_select.cc:4172
      #9  0x0000555555c11ed2 in handle_select (thd=0x7fffe0000d60, 
          lex=0x7fffe0004938, result=0x7fffe001a330, setup_tables_done_option=0)
          at /home/dan/software_projects/mariadb-server/sql/sql_select.cc:370
      #10 0x0000555555bde0e9 in execute_sqlcom_select (thd=0x7fffe0000d60, 
          all_tables=0x7fffe0015360)
          at /home/dan/software_projects/mariadb-server/sql/sql_parse.cc:6552
      #11 0x0000555555bd442e in mysql_execute_command (thd=0x7fffe0000d60)
          at /home/dan/software_projects/mariadb-server/sql/sql_parse.cc:3763
      #12 0x0000555555be19cf in mysql_parse (thd=0x7fffe0000d60, 
          rawbuf=0x7fffe0014ca8 "SELECT a.f3, cr.f4, count(*) count\nFROM t2 a\nSTRAIGHT_JOIN t1 cr ON cr.f2 = a.f1\nLEFT JOIN\n(t1 cr2\nJOIN t3 ae2 ON cr2.f3 = ae2.f1\n) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND\ncr.f4 = cr2"..., ---Type <return> to continue, or q <return> to quit---
      length=224, parser_state=0x7ffff2b7a480, is_com_multi=false, 
          is_next_command=false)
          at /home/dan/software_projects/mariadb-server/sql/sql_parse.cc:8009
      #13 0x0000555555bcefe2 in dispatch_command (command=COM_QUERY, 
          thd=0x7fffe0000d60, 
          packet=0x7fffe000b311 "SELECT a.f3, cr.f4, count(*) count\nFROM t2 a\nSTRAIGHT_JOIN t1 cr ON cr.f2 = a.f1\nLEFT JOIN\n(t1 cr2\nJOIN t3 ae2 ON cr2.f3 = ae2.f1\n) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND\ncr.f4 = cr2"..., packet_length=224, is_com_multi=false, is_next_command=false)
          at /home/dan/software_projects/mariadb-server/sql/sql_parse.cc:1837
       
      #14 0x0000555555bcdad2 in do_command (thd=0x7fffe0000d60)
          at /home/dan/software_projects/mariadb-server/sql/sql_parse.cc:1382
      #15 0x0000555555d2c968 in do_handle_one_connection (connect=0x555557c1a690)
          at /home/dan/software_projects/mariadb-server/sql/sql_connect.cc:1402
      #16 0x0000555555d2c6e8 in handle_one_connection (arg=0x555557c1a690)
          at /home/dan/software_projects/mariadb-server/sql/sql_connect.cc:1308
      #17 0x00007ffff7bc150b in start_thread (arg=0x7ffff2b7b700)
          at pthread_create.c:465
      #18 0x00007ffff558016f in clone ()
          at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      (gdb) 
      (gdb) 
      (gdb) 
      (gdb) list
      1836           eq_mod != equality_mods + n_equality_mods; eq_mod++)
      1837      {
      1838        char buf[128];
      1839        String str(buf, sizeof(buf), &my_charset_bin);
      1840        str.length(0);
      1841        eq_mod->expr->print(&str, QT_ORDINARY);
      1842        if (eq_mod->field)
      1843        {
      1844          fprintf(DBUG_FILE, "  equality%ld: %s -> %s.%s\n", 
      1845                  (long)(eq_mod - equality_mods),
      (gdb) p *eq_mod
      $1 = {<Dep_module> = {<Sql_alloc> = {<No data fields>}, 
          _vptr.Dep_module = 0x555556f5c100 <vtable for Dep_module_expr+16>, 
          static iterator_size = 40, unbound_args = 1}, field = 0x0, expr = 0x0, 
        mult_equal_fields = 0x7fffe01d6230, level = 0, static iterator_size = 40}
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sanja Oleksandr Byelkin
              Reporter:
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: