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

Server crashes in table_events_waits_common::make_row upon race condition while querying perfschema

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Cannot Reproduce
    • 10.1, 10.2, 10.3
    • N/A
    • Admin statements
    • None

    Description

      The problem is reproducible very unreliably, sometimes it's fast, sometimes it takes hundreds of repetitions. Luckily, the test is short. Run with --repeat=1000.

      Make sure that your plugin directory is populated. It might have something to do with TokuDB in general or MDEV-15174 in particular – I can't get the failure without ha_tokudb in the plugin directory.

      The test case (and bug report) is for 10.3, because I couldn't get rid of INTERSECT in the scenario. Maybe when the reason is known, it will be possible to reproduce with the syntax applicable to previous versions.

      --source include/have_perfschema.inc
       
      SELECT COUNT(*) FROM INFORMATION_SCHEMA.ALL_PLUGINS;
      UPDATE performance_schema.setup_instruments SET ENABLED = 'YES' WHERE NAME IN ('stage/sql/Commit_implicit','statement/sql/show_generic');
      UPDATE performance_schema.setup_consumers SET enabled = 'YES' WHERE NAME IN ( 'events_waits_history' );
       
      --connect (con1,localhost,root,,test)
      --connect (con2,localhost,root,,test)
      --send
      ( SELECT * FROM INFORMATION_SCHEMA.ALL_PLUGINS AS pl ORDER BY pl.PLUGIN_AUTH_VERSION ) INTERSECT ( SELECT * FROM INFORMATION_SCHEMA.ALL_PLUGINS AS pl ORDER BY pl.PLUGIN_AUTH_VERSION );
       
      --connection con1
      DROP TABLE IF EXISTS t1, t2;
      CREATE PROCEDURE sp() SELECT * FROM mysql.time_zone HAVING Use_leap_seconds = 'Y' AND Use_leap_seconds = 'Y';
      CALL sp;
      DROP PROCEDURE sp;
      SELECT * FROM performance_schema.events_waits_history ORDER BY TIMER_START;
       
      --connection con2
      --reap
      

      10.3 d70573564cb2701076083ea7f55ae9539fad13b4

      #3  <signal handler called>
      #4  0x00005623230b78b1 in dirname_length (name=0x7f6f8737eae0 <error: Cannot access memory at address 0x7f6f8737eae0>) at /data/src/10.3/mysys/mf_dirname.c:33
      #5  0x0000562322c0bba3 in table_events_waits_common::make_row (this=0x7f6f7404bf30, thread_own_wait=true, pfs_thread=0x7f6f8fd6a0c0, wait=0x7f6f8fd0d1a8) at /data/src/10.3/storage/perfschema/table_events_waits.cc:429
      #6  0x0000562322c0c857 in table_events_waits_history::rnd_next (this=0x7f6f7404bf30) at /data/src/10.3/storage/perfschema/table_events_waits.cc:883
      #7  0x0000562322bedf13 in ha_perfschema::rnd_next (this=0x7f6f7403c328, buf=0x7f6f74044bc8 "\340\063\t") at /data/src/10.3/storage/perfschema/ha_perfschema.cc:344
      #8  0x0000562322921ac6 in handler::ha_rnd_next (this=0x7f6f7403c328, buf=0x7f6f74044bc8 "\340\063\t") at /data/src/10.3/sql/handler.cc:2759
      #9  0x000056232291600e in find_all_keys (thd=0x7f6f74000b00, param=0x7f6f8c1fe560, select=0x7f6f74049bb8, fs_info=0x7f6f7404bd40, buffpek_pointers=0x7f6f8c1fe760, tempfile=0x7f6f8c1fe5f0, pq=0x0, found_rows=0x7f6f7404bf20) at /data/src/10.3/sql/filesort.cc:790
      #10 0x0000562322914570 in filesort (thd=0x7f6f74000b00, table=0x7f6f7403b6e0, filesort=0x7f6f74049d88, tracker=0x7f6f7404a588, join=0x7f6f74018078, first_table_bit=1) at /data/src/10.3/sql/filesort.cc:278
      #11 0x00005623226b0b18 in create_sort_index (thd=0x7f6f74000b00, join=0x7f6f74018078, tab=0x7f6f74049268, fsort=0x7f6f74049d88) at /data/src/10.3/sql/sql_select.cc:22359
      #12 0x00005623226ab426 in st_join_table::sort_table (this=0x7f6f74049268) at /data/src/10.3/sql/sql_select.cc:20194
      #13 0x00005623226ab03a in join_init_read_record (tab=0x7f6f74049268) at /data/src/10.3/sql/sql_select.cc:20135
      #14 0x00005623226a8fca in sub_select (join=0x7f6f74018078, join_tab=0x7f6f74049268, end_of_records=false) at /data/src/10.3/sql/sql_select.cc:19229
      #15 0x00005623226a8595 in do_select (join=0x7f6f74018078, procedure=0x0) at /data/src/10.3/sql/sql_select.cc:18772
      #16 0x0000562322681646 in JOIN::exec_inner (this=0x7f6f74018078) at /data/src/10.3/sql/sql_select.cc:3987
      #17 0x0000562322680ade in JOIN::exec (this=0x7f6f74018078) at /data/src/10.3/sql/sql_select.cc:3781
      #18 0x0000562322681d1f in mysql_select (thd=0x7f6f74000b00, tables=0x7f6f74013c20, wild_num=1, fields=..., conds=0x0, og_num=1, order=0x7f6f74014398, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f6f74018058, unit=0x7f6f74004938, select_lex=0x7f6f740050b0) at /data/src/10.3/sql/sql_select.cc:4186
      #19 0x0000562322673ffd in handle_select (thd=0x7f6f74000b00, lex=0x7f6f74004870, result=0x7f6f74018058, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:382
      #20 0x000056232263f153 in execute_sqlcom_select (thd=0x7f6f74000b00, all_tables=0x7f6f74013c20) at /data/src/10.3/sql/sql_parse.cc:6552
      #21 0x000056232263576d in mysql_execute_command (thd=0x7f6f74000b00) at /data/src/10.3/sql/sql_parse.cc:3763
      #22 0x0000562322642b4c in mysql_parse (thd=0x7f6f74000b00, rawbuf=0x7f6f74013988 "SELECT * FROM performance_schema.events_waits_history ORDER BY TIMER_START", length=74, parser_state=0x7f6f8c2005d0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8009
      #23 0x0000562322630200 in dispatch_command (command=COM_QUERY, thd=0x7f6f74000b00, packet=0x7f6f7400b251 "", packet_length=74, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1838
      #24 0x000056232262ec3f in do_command (thd=0x7f6f74000b00) at /data/src/10.3/sql/sql_parse.cc:1383
      #25 0x00005623227930fd in do_handle_one_connection (connect=0x56232553c9b0) at /data/src/10.3/sql/sql_connect.cc:1402
      #26 0x0000562322792e8a in handle_one_connection (arg=0x56232553c9b0) at /data/src/10.3/sql/sql_connect.cc:1308
      #27 0x0000562322c20f11 in pfs_spawn_thread (arg=0x562325550600) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #28 0x00007f6f93579494 in start_thread (arg=0x7f6f8c201700) at pthread_create.c:333
      #29 0x00007f6f9195f93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.