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

Assertion `mdl_request->ticket == __null' failed

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      CLI compatible test case:-

      CREATE FUNCTION f1() RETURNS INT RETURN 1;
      CREATE TABLE t2 (a INT);
      CREATE VIEW v1 AS SELECT f1();
      REPAIR VIEW v1,t2;
      

      Leads to:

      CS 13.0.2 b2c4e675049e23ce8c7346985f40840fcd4e583f (Debug, Clang 22.1.8-20260621) Build 09/09/2026

      mariadbd: /test/13.0_dbg/sql/mdl.cc:2692: bool MDL_context::try_acquire_lock_impl(MDL_request *, MDL_ticket **): Assertion `mdl_request->ticket == __null' failed.
      

      CS 13.0.2 b2c4e675049e23ce8c7346985f40840fcd4e583f (Debug, Clang 22.1.8-20260621) Build 09/09/2026

      Core was generated by `/test/MD090926-mariadb-13.0.2-linux-x86_64-dbg/bin/mariadbd --no-defaults --loo'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 2015794)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x00007f58c304527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007f58c30288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x00007f58c302881b in __assert_fail_base (fmt=0x7f58c31d1208 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x6460a7a54a39 "mdl_request->ticket == __null", file=file@entry=0x6460a7a545dd "/test/13.0_dbg/sql/mdl.cc", line=line@entry=2692, function=function@entry=0x6460a7a54a57 "bool MDL_context::try_acquire_lock_impl(MDL_request *, MDL_ticket **)") at ./assert/assert.c:96
      #6  0x00007f58c303b517 in __assert_fail (assertion=0x6460a7a54a39 "mdl_request->ticket == __null", file=0x6460a7a545dd "/test/13.0_dbg/sql/mdl.cc", line=2692, function=0x6460a7a54a57 "bool MDL_context::try_acquire_lock_impl(MDL_request *, MDL_ticket **)") at ./assert/assert.c:105
      #7  0x00006460a6c1e8df in MDL_context::try_acquire_lock_impl (this=0x77578c000f80, mdl_request=0x77578c01fca0, out_ticket=0x7f589c895060)at /test/13.0_dbg/sql/mdl.cc:2692
      #8  0x00006460a6c1f056 in MDL_context::acquire_lock (this=0x77578c000f80, mdl_request=0x77578c01fca0, lock_wait_timeout=86400)at /test/13.0_dbg/sql/mdl.cc:2895
      #9  0x00006460a6990e47 in sp_acquire_mdl (thd=0x77578c000d60, rt=0x77578c01fca0, ot_ctx=0x7f589c895298)at /test/13.0_dbg/sql/sql_base.cc:3853
      #10 0x00006460a6985785 in open_and_process_routine (thd=0x77578c000d60, prelocking_ctx=0x77578c0051a8, rt=0x77578c01fca0, prelocking_strategy=0x7f589c895d70, has_prelocking_list=true, ot_ctx=0x7f589c895298, need_prelocking=0x7f589c895277, routine_modifies_data=0x7f589c895276)at /test/13.0_dbg/sql/sql_base.cc:3930
      #11 0x00006460a6984126 in open_tables (thd=0x77578c000d60, options=@0x77578c00688c: {m_options = DDL_options_st::OPT_NONE}, start=0x7f589c895e70, counter=0x7f589c895dcc, flags=0, prelocking_strategy=0x7f589c895d70) at /test/13.0_dbg/sql/sql_base.cc:4854
      #12 0x00006460a6b5c97a in open_tables (thd=0x77578c000d60, tables=0x7f589c895e70, counter=0x7f589c895dcc, flags=0, prelocking_strategy=0x7f589c895d70) at /test/13.0_dbg/sql/sql_base.h:275
      #13 0x00006460a6b573d7 in mysql_alter_table (thd=0x77578c000d60, new_db=0x6460a7c4d9e0 <null_clex_str>, new_name=0x6460a7c4d9e0 <null_clex_str>, create_info=0x7f589c898660, table_list=0x77578c01ac60, recreate_info=0x7f589c899eb0, alter_info=0x7f589c8984e8, order_num=0, order=0x0, ignore=true, if_exists=false) at /test/13.0_dbg/sql/sql_table.cc:10926
      #14 0x00006460a6b664b5 in mysql_recreate_table (thd=0x77578c000d60, table_list=0x77578c01ac60, recreate_info=0x7f589c899eb0, table_copy=true)at /test/13.0_dbg/sql/sql_table.cc:13330
      #15 0x00006460a6c2b169 in admin_recreate_table (thd=0x77578c000d60, table_list=0x77578c01ac60, recreate_info=0x7f589c899eb0, table_copy=true)at /test/13.0_dbg/sql/sql_admin.cc:78
      #16 0x00006460a6c27bad in mysql_admin_table (thd=0x77578c000d60, tables=0x77578c01a4b0, check_opt=0x77578c006638, operator_name=0x6460a8328088 <msg_repair>, lock_type=TL_WRITE, org_open_for_modify=true, no_errors_from_open=false, extra_open_options=32, prepare_func=0x6460a6c29ff0 <prepare_for_repair(THD*, TABLE_LIST*, st_ha_check_opt*)>, operator_func=(int (handler::*)(class handler * const, class THD *, HA_CHECK_OPT *)) 0x6460a6e54f70 <handler::ha_repair(THD*, st_ha_check_opt*)>, view_operator_func=0x6460a6ba32d0 <view_repair(THD*, TABLE_LIST*, st_ha_check_opt*)>, is_cmd_replicated=true) at /test/13.0_dbg/sql/sql_admin.cc:1134
      #17 0x00006460a6c29fb0 in Sql_cmd_repair_table::execute (this=0x77578c01b3b0, thd=0x77578c000d60) at /test/13.0_dbg/sql/sql_admin.cc:1755
      #18 0x00006460a6a4bc06 in mysql_execute_command (thd=0x77578c000d60, is_called_from_prepared_stmt=false) at /test/13.0_dbg/sql/sql_parse.cc:5905
      #19 0x00006460a6a3cd18 in mysql_parse (thd=0x77578c000d60, rawbuf=0x77578c01a3c0 "REPAIR VIEW v1,t2", length=17, parser_state=0x7f589c89b9f0) at /test/13.0_dbg/sql/sql_parse.cc:7943
      #20 0x00006460a6a3a46e in dispatch_command (command=COM_QUERY, thd=0x77578c000d60, packet=0x77578c00b5f1 "", packet_length=17, blocking=true) at /test/13.0_dbg/sql/sql_parse.cc:1903
      #21 0x00006460a6a3d79a in do_command (thd=0x77578c000d60, blocking=true)at /test/13.0_dbg/sql/sql_parse.cc:1437
      #22 0x00006460a6c0f75e in do_handle_one_connection (connect=0x6460e664c880, put_in_cache=true) at /test/13.0_dbg/sql/sql_connect.cc:1514
      #23 0x00006460a6c0f541 in handle_one_connection (arg=0x6460e662b1e0)at /test/13.0_dbg/sql/sql_connect.cc:1426
      #24 0x00007f58c309cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #25 0x00007f58c3129ecc in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.11  dbg  090926  2753b5919a10abd32ba822877c6a1cbf602d3748  No bug found                  
      CS  10.11  opt  090926  2753b5919a10abd32ba822877c6a1cbf602d3748  No bug found                  
      CS  11.4   dbg  090926  42038e1145dd43b3910055c364fb720a8a152d61  No bug found                  
      CS  11.4   opt  090926  42038e1145dd43b3910055c364fb720a8a152d61  No bug found                  
      CS  11.8   dbg  090926  e2e060ce3d8c3ce11b6c7ba28ced0f1a30c50a54  mdl_request->ticket == __null|SIGABRT|MDL_context::try_acquire_lock_impl|MDL_context::acquire_lock|sp_acquire_mdl|open_and_process_routine
      CS  11.8   opt  090926  e2e060ce3d8c3ce11b6c7ba28ced0f1a30c50a54  No bug found                  
      CS  12.3   dbg  090926  e9f84a1fdf7093191e55b55dc14b08b9d4ebaa20  mdl_request->ticket == __null|SIGABRT|MDL_context::try_acquire_lock_impl|MDL_context::acquire_lock|sp_acquire_mdl|open_and_process_routine
      CS  12.3   opt  090926  e9f84a1fdf7093191e55b55dc14b08b9d4ebaa20  No bug found                  
      CS  13.0   dbg  090926  b2c4e675049e23ce8c7346985f40840fcd4e583f  mdl_request->ticket == __null|SIGABRT|MDL_context::try_acquire_lock_impl|MDL_context::acquire_lock|sp_acquire_mdl|open_and_process_routine
      CS  13.0   opt  090926  b2c4e675049e23ce8c7346985f40840fcd4e583f  No bug found                  
      CS  13.1   dbg  090926  02c842c30dcb05a962eaac58c69920e6be3369cf  mdl_request->ticket == __null|SIGABRT|MDL_context::try_acquire_lock_impl|MDL_context::acquire_lock|sp_acquire_mdl|open_and_process_routine
      CS  13.1   opt  090926  02c842c30dcb05a962eaac58c69920e6be3369cf  No bug found                  
      ES  10.6   dbg  090926  aa3fb9800c358182ee2a1f8cca8ffbdd6d0a37eb  No bug found                  
      ES  10.6   opt  090926  aa3fb9800c358182ee2a1f8cca8ffbdd6d0a37eb  No bug found                  
      ES  11.4   dbg  090926  32807340954440071ca8ae8e2de51fb180d134c6  mdl_request->ticket == __null|SIGABRT|MDL_context::try_acquire_lock_impl|MDL_context::acquire_lock|sp_acquire_mdl|open_and_process_routine
      ES  11.4   opt  090926  32807340954440071ca8ae8e2de51fb180d134c6  No bug found                  
      ES  11.8   dbg  090926  c4af6f687a2dd983072457429aa2294f11957650  mdl_request->ticket == __null|SIGABRT|MDL_context::try_acquire_lock_impl|MDL_context::acquire_lock|sp_acquire_mdl|open_and_process_routine
      ES  11.8   opt  090926  c4af6f687a2dd983072457429aa2294f11957650  No bug found                  
      ES  12.3   dbg  090926  c3bd5108d81f19e33efb93f7b6ae971293732fd0  mdl_request->ticket == __null|SIGABRT|MDL_context::try_acquire_lock_impl|MDL_context::acquire_lock|sp_acquire_mdl|open_and_process_routine
      ES  12.3   opt  090926  c3bd5108d81f19e33efb93f7b6ae971293732fd0  No bug found                  
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            saahil Saahil Alam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 1.5h
                1.5h

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.