[MDEV-26385] Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->s->db.str, table->s->table_name.str, MDL_SHARED)' failed in void close_thread_table(THD*, TABLE**) Created: 2021-08-17  Updated: 2021-08-17

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.2
Fix Version/s: 10.2

Type: Bug Priority: Major
Reporter: Ramesh Sivaraman Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None


 Description   

The crash is happening when we run multi thread pquery run.



 Comments   
Comment by Jan Lindström (Inactive) [ 2021-08-17 ]

(rr) where
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x000014ed0cbff859 in __GI_abort () at abort.c:79
#2  0x000014ed0cbff729 in __assert_fail_base (fmt=0x14ed0cd95588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=0x561298db5298 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->s->db.str, table->s->table_name.str, MDL_SHARED)", 
    file=0x561298db4d60 "/test/mtest/10.2_dbg/sql/sql_base.cc", line=880, function=<optimized out>) at assert.c:92
#3  0x000014ed0cc10f36 in __GI___assert_fail (
    assertion=assertion@entry=0x561298db5298 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->s->db.str, table->s->table_name.str, MDL_SHARED)", 
    file=file@entry=0x561298db4d60 "/test/mtest/10.2_dbg/sql/sql_base.cc", line=line@entry=880, 
    function=function@entry=0x561298db5218 "void close_thread_table(THD*, TABLE**)") at assert.c:101
#4  0x00005612983a68ae in close_thread_table (thd=thd@entry=0x37845c06b510, table_ptr=table_ptr@entry=0x714766d675f8)
    at /test/mtest/10.2_dbg/sql/sql_base.cc:888
#5  0x00005612983e0181 in mysql_ha_close_table (handler=handler@entry=0x37845c08a280) at /test/mtest/10.2_dbg/sql/sql_handler.cc:175
#6  0x00005612983e2dee in mysql_ha_flush (thd=thd@entry=0x37845c06b510) at /test/mtest/10.2_dbg/sql/sql_handler.cc:1086
#7  0x00005612983ace02 in open_tables (thd=thd@entry=0x37845c06b510, options=..., start=start@entry=0x714766d67828, counter=counter@entry=0x714766d6783c, 
    flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x714766d678c0) at /test/mtest/10.2_dbg/sql/sql_base.cc:3988
#8  0x00005612983ae117 in open_and_lock_tables (thd=thd@entry=0x37845c06b510, options=..., tables=<optimized out>, tables@entry=0x37845c07f050, 
    derived=derived@entry=true, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x714766d678c0)
    at /test/mtest/10.2_dbg/sql/sql_base.cc:4861
#9  0x00005612983fca93 in open_and_lock_tables (flags=0, derived=true, tables=0x37845c07f050, thd=0x37845c06b510) at /test/mtest/10.2_dbg/sql/sql_base.h:508
#10 execute_sqlcom_select (thd=thd@entry=0x37845c06b510, all_tables=0x37845c07f050) at /test/mtest/10.2_dbg/sql/sql_parse.cc:6192
#11 0x000056129840716c in mysql_execute_command (thd=thd@entry=0x37845c06b510) at /test/mtest/10.2_dbg/sql/sql_parse.cc:3582
#12 0x0000561298410809 in mysql_parse (thd=thd@entry=0x37845c06b510, 
    rawbuf=rawbuf@entry=0x37845c07ec18 "select spid,count(*) FROM t1  where spid between 1 and 2 group by spid", length=length@entry=70, 
    parser_state=parser_state@entry=0x714766d69540, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false)
    at /test/mtest/10.2_dbg/sql/sql_parse.cc:7793
#13 0x0000561298411e12 in wsrep_mysql_parse (thd=thd@entry=0x37845c06b510, 
    rawbuf=0x37845c07ec18 "select spid,count(*) FROM t1  where spid between 1 and 2 group by spid", length=70, 
    parser_state=parser_state@entry=0x714766d69540, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false)
    at /test/mtest/10.2_dbg/sql/sql_parse.cc:7585
#14 0x000056129841336b in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x37845c06b510, 
    packet=packet@entry=0x37845c072e21 "select spid,count(*) FROM t1  where spid between 1 and 2 group by spid;", packet_length=packet_length@entry=71, 
    is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/mtest/10.2_dbg/sql/sql_class.h:1109
#15 0x000056129841614a in do_command (thd=0x37845c06b510) at /test/mtest/10.2_dbg/sql/sql_parse.cc:1381
#16 0x000056129851c1b1 in do_handle_one_connection (connect=connect@entry=0x26f737ae36c0) at /test/mtest/10.2_dbg/sql/sql_connect.cc:1336
#17 0x000056129851c3dc in handle_one_connection (arg=0x26f737ae36c0) at /test/mtest/10.2_dbg/sql/sql_connect.cc:1241
#18 0x00007c7a2ec73609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#19 0x000014ed0ccfc293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Generated at Thu Feb 08 09:44:54 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.