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

Crash (pure virtual method called) in or around handler::ha_external_lock for simple SELECT with join

    XMLWordPrintable

Details

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

    Description

      MariaDB 10.1.29 crashed as follows:

      (gdb) bt
      #0 0x00007ffff5c6e207 in raise () from /lib64/libc.so.6
      #1 0x00007ffff5c6f8f8 in abort () from /lib64/libc.so.6
      #2 0x00007ffff5cb0cc7 in __libc_message () from /lib64/libc.so.6
      #3 0x00007ffff5d50677 in __fortify_fail () from /lib64/libc.so.6
      #4 0x00007ffff5d4e7f2 in __chk_fail () from /lib64/libc.so.6
      #5 0x00007ffff5d505d7 in __fdelt_warn () from /lib64/libc.so.6
      #6 0x00005555560051b8 in my_addr_resolve (ptr=0x555555ff165e <my_print_stacktrace+46>, loc=loc@entry=0x7feb404a4830) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/mysys/my_addr_resolve.c:162
      #7 0x0000555555ff17f2 in print_with_addr_resolve (n=<optimized out>, addrs=0x7feb404a4850) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/mysys/stacktrace.c:253
      #8 my_print_stacktrace (stack_bottom=<optimized out>, thread_stack=295936) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/mysys/stacktrace.c:271
      #9 0x0000555555b15015 in handle_fatal_signal (sig=6) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/signal_handler.cc:166
      #10 <signal handler called>
      #11 0x00007ffff5c6e207 in raise () from /lib64/libc.so.6
      #12 0x00007ffff5c6f8f8 in abort () from /lib64/libc.so.6
      #13 0x00007ffff63677d5 in __gnu_cxx::__verbose_terminate_handler() () from /lib64/libstdc++.so.6
      #14 0x00007ffff6365746 in ?? () from /lib64/libstdc++.so.6
      #15 0x00007ffff6365773 in std::terminate() () from /lib64/libstdc++.so.6
      #16 0x00007ffff63662df in __cxa_pure_virtual () from /lib64/libstdc++.so.6
      #17 0x0000555555b1f81b in handler::ha_external_lock (this=0x7fe48da10820, thd=thd@entry=0x7fe492821008, lock_type=lock_type@entry=2) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/handler.cc:5891
      #18 0x0000555555bdfbe5 in unlock_external (count=<optimized out>, table=0x7fe44cae3f98, thd=0x7fe492821008) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/lock.cc:689
      #19 mysql_unlock_read_tables (thd=0x7fe492821008, sql_lock=0x7fe44cae3f60) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/lock.cc:450
      #20 0x00005555559d297b in JOIN::join_free (this=this@entry=0x7fe44cae3fc8) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/sql_select.cc:11990
      #21 0x00005555559d2c24 in do_select (join=join@entry=0x7fe44cae3fc8, fields=fields@entry=0x7fe492825160, table=table@entry=0x0, procedure=0x0) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/sql_select.cc:18103
      #22 0x00005555559e565c in JOIN::exec_inner (this=this@entry=0x7fe44cae3fc8) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/sql_select.cc:3225
      #23 0x00005555559e7664 in JOIN::exec (this=this@entry=0x7fe44cae3fc8) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/sql_select.cc:2512
      #24 0x00005555559e3ce2 in mysql_select (thd=thd@entry=0x7fe492821008, rref_pointer_array=rref_pointer_array@entry=0x7fe4928252f0, tables=<optimized out>, wild_num=<optimized out>, fields=..., conds=<optimized out>, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2148272640,
      result=result@entry=0x7fe44cae3fa8, unit=unit@entry=0x7fe492824948, select_lex=select_lex@entry=0x7fe492825048) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/sql_select.cc:3449
      #25 0x00005555559e47e5 in handle_select (thd=thd@entry=0x7fe492821008, lex=lex@entry=0x7fe492824880, result=result@entry=0x7fe44cae3fa8, setup_tables_done_option=setup_tables_done_option@entry=0) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/sql_select.cc:384
      #26 0x00005555558ca44f in execute_sqlcom_select (thd=thd@entry=0x7fe492821008, all_tables=0x7fe44cae2450) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/sql_parse.cc:5923
      #27 0x000055555598f10e in mysql_execute_command (thd=thd@entry=0x7fe492821008) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/sql_parse.cc:2975
      #28 0x0000555555991cc2 in mysql_parse (thd=0x7fe492821008, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/sql_parse.cc:7344
      #29 0x000055555599562a in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7fe492821008, packet=packet@entry=0x7fe478deb009 "", packet_length=packet_length@entry=288) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/sql_parse.cc:1477
      #30 0x0000555555995f86 in do_command (thd=0x7fe492821008) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/sql_parse.cc:1106
      #31 0x0000555555a61dfa in do_handle_one_connection (thd_arg=thd_arg@entry=0x7fe4904c7008) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/sql_connect.cc:1349
      #32 0x0000555555a61fa0 in handle_one_connection (arg=arg@entry=0x7fe4904c7008) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/sql/sql_connect.cc:1261
      #33 0x0000555555ca249d in pfs_spawn_thread (arg=0x7fe4675b0c08) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.1.29/storage/perfschema/pfs.cc:1861
      #34 0x00007ffff7bc5dd5 in start_thread () from /lib64/libpthread.so.0
      #35 0x00007ffff5d36b3d in clone () from /lib64/libc.so.6
      

      Crashing query was simple enough SELECT joining two (small) InnoDB tables, like this:

      select
      t1.*
      from
      t1, t
      where
      t.id1 = 577
      and t1.c1 = 'something'
      and t.ts = t1.somets
      and t.id1 = t1.id1;
      

      Running the query again after restart does not lead to crashes. There is nothing in the error log for days before the crash. EXPLAIN output after restart is like this:

      *************************** 1. row ***************************
      id: 1
      select_type: SIMPLE
      table: t
      type: ref
      possible_keys: unq,id1,id2
      key: id2
      key_len: 4
      ref: const
      rows: 3984
      Extra: Using index
      *************************** 2. row ***************************
      id: 1
      select_type: SIMPLE
      table: t1
      type: ref
      possible_keys: c1,id1,somets
      key: somets
      key_len: 9
      ref: db.t.ts
      rows: 1
      Extra: Using index condition; Using where
      2 rows in set (0.01 sec)
      

      May be related/similar to https://jira.mariadb.org/browse/MDEV-17597, but no downgrade happened.

      Attachments

        Issue Links

          Activity

            People

              varun Varun Gupta (Inactive)
              valerii Valerii Kravchuk
              Votes:
              2 Vote for this issue
              Watchers:
              5 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.