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

Server crash in thr_multi_unlock or in get_schema_tables_result upon select from I_S with joins

    XMLWordPrintable

    Details

      Description

      CREATE TABLE t1 (a TIMESTAMP, KEY (a));
      INSERT INTO t1 VALUES ('2012-12-12'),('2021-11-11');
       
      SELECT * FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.ROUTINES) ON (t1b.a IS NULL);
       
      # Cleanup
      DROP TABLE t1;
      

      10.3 da88e1ec

      #3  <signal handler called>
      #4  thr_unlock (data=0x7f76f0072ca8, unlock_flags=0) at /data/src/10.3/mysys/thr_lock.c:1087
      #5  0x000055d515315283 in thr_multi_unlock (data=0x7f76f009c270, count=2, unlock_flags=0) at /data/src/10.3/mysys/thr_lock.c:1416
      #6  0x000055d514bc5955 in mysql_unlock_tables (thd=0x7f76f0000d90, sql_lock=0x7f76f009c250, free_lock=false) at /data/src/10.3/sql/lock.cc:431
      #7  0x000055d514bc5ac2 in mysql_unlock_some_tables (thd=0x7f76f0000d90, table=0x7f76f0052900, count=2, flag=4) at /data/src/10.3/sql/lock.cc:454
      #8  0x000055d5147a5ac2 in JOIN::optimize_stage2 (this=0x7f76f0017d58) at /data/src/10.3/sql/sql_select.cc:2060
      #9  0x000055d5147a55f0 in JOIN::optimize_inner (this=0x7f76f0017d58) at /data/src/10.3/sql/sql_select.cc:1985
      #10 0x000055d5147a39c0 in JOIN::optimize (this=0x7f76f0017d58) at /data/src/10.3/sql/sql_select.cc:1501
      #11 0x000055d5147adb12 in mysql_select (thd=0x7f76f0000d90, tables=0x7f76f0012d50, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2684619520, result=0x7f76f0017d30, unit=0x7f76f0004c58, select_lex=0x7f76f00053e0) at /data/src/10.3/sql/sql_select.cc:4309
      #12 0x000055d51479f13e in handle_select (thd=0x7f76f0000d90, lex=0x7f76f0004b98, result=0x7f76f0017d30, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:370
      #13 0x000055d514765804 in execute_sqlcom_select (thd=0x7f76f0000d90, all_tables=0x7f76f0012d50) at /data/src/10.3/sql/sql_parse.cc:6316
      #14 0x000055d51475c011 in mysql_execute_command (thd=0x7f76f0000d90) at /data/src/10.3/sql/sql_parse.cc:3847
      #15 0x000055d514769b88 in mysql_parse (thd=0x7f76f0000d90, rawbuf=0x7f76f0012ab8 "SELECT * FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.ROUTINES) ON (t1b.a IS NULL)", length=97, parser_state=0x7f7701f105c0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7840
      #16 0x000055d5147562ec in dispatch_command (command=COM_QUERY, thd=0x7f76f0000d90, packet=0x7f76f0008f11 "SELECT * FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.ROUTINES) ON (t1b.a IS NULL)", packet_length=97, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1852
      #17 0x000055d514754c8c in do_command (thd=0x7f76f0000d90) at /data/src/10.3/sql/sql_parse.cc:1398
      #18 0x000055d5148d3295 in do_handle_one_connection (connect=0x55d516b93150) at /data/src/10.3/sql/sql_connect.cc:1403
      #19 0x000055d5148d2ff1 in handle_one_connection (arg=0x55d516b93150) at /data/src/10.3/sql/sql_connect.cc:1308
      #20 0x000055d51529f061 in pfs_spawn_thread (arg=0x55d516b76320) at /data/src/10.3/storage/perfschema/pfs.cc:1869
      #21 0x00007f77083fb609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #22 0x00007f7707fd7293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      CREATE TABLE t1 (a TIMESTAMP, KEY (a));
      INSERT INTO t1 VALUES ('2012-12-12'),('2021-11-11');
       
      SELECT * FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.PROFILING) ON (t1b.a IS NULL);
       
      # Cleanup
      DROP TABLE t1;
      

      10.3 da88e1ec

      #3  <signal handler called>
      #4  get_schema_tables_result (join=0x7fba600170f8, executed_place=PROCESSED_BY_JOIN_EXEC) at /data/src/10.3/sql/sql_show.cc:8881
      #5  0x0000564284658286 in JOIN::exec_inner (this=0x7fba600170f8) at /data/src/10.3/sql/sql_select.cc:4087
      #6  0x000056428465788e in JOIN::exec (this=0x7fba600170f8) at /data/src/10.3/sql/sql_select.cc:3918
      #7  0x0000564284658bab in mysql_select (thd=0x7fba60000d90, tables=0x7fba60012d58, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2684619520, result=0x7fba600170d0, unit=0x7fba60004c58, select_lex=0x7fba600053e0) at /data/src/10.3/sql/sql_select.cc:4323
      #8  0x000056428464a13e in handle_select (thd=0x7fba60000d90, lex=0x7fba60004b98, result=0x7fba600170d0, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:370
      #9  0x0000564284610804 in execute_sqlcom_select (thd=0x7fba60000d90, all_tables=0x7fba60012d58) at /data/src/10.3/sql/sql_parse.cc:6316
      #10 0x0000564284607011 in mysql_execute_command (thd=0x7fba60000d90) at /data/src/10.3/sql/sql_parse.cc:3847
      #11 0x0000564284614b88 in mysql_parse (thd=0x7fba60000d90, rawbuf=0x7fba60012ab8 "SELECT * FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.PROFILING) ON (t1b.a IS NULL)", length=98, parser_state=0x7fba712875c0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7840
      #12 0x00005642846012ec in dispatch_command (command=COM_QUERY, thd=0x7fba60000d90, packet=0x7fba60008f11 "SELECT * FROM t1 AS t1a LEFT JOIN (t1 AS t1b JOIN INFORMATION_SCHEMA.PROFILING) ON (t1b.a IS NULL)", packet_length=98, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1852
      #13 0x00005642845ffc8c in do_command (thd=0x7fba60000d90) at /data/src/10.3/sql/sql_parse.cc:1398
      #14 0x000056428477e295 in do_handle_one_connection (connect=0x564287dd6150) at /data/src/10.3/sql/sql_connect.cc:1403
      #15 0x000056428477dff1 in handle_one_connection (arg=0x564287dd6150) at /data/src/10.3/sql/sql_connect.cc:1308
      #16 0x000056428514a061 in pfs_spawn_thread (arg=0x564287db9320) at /data/src/10.3/storage/perfschema/pfs.cc:1869
      #17 0x00007fba77772609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #18 0x00007fba7734e293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      The difference between two test cases is only which I_S table they select from. It seems to have some effect on which stack trace the server eventually crashes with, but not completely reliably. In any case, it always crashes for me with at least one of the two.

      The failure is not a recent regression, it also crashes on much older versions of 10.3 (e.g. 10.3.13).
      Could not reproduce on 10.2.

        Attachments

          Activity

            People

            Assignee:
            monty Michael Widenius
            Reporter:
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: