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

Assertion `mutex->__data.__owner == 0' failed in pthread_mutex_lock/psi_mutex_lock

    XMLWordPrintable

Details

    Description

      INSTALL PLUGIN spider SONAME 'ha_spider.so';
      CREATE TEMPORARY TABLE t (c INT,c2 INT) ENGINE=SPIDER UNION=(t,t2) INSERT_METHOD=LAST;
      INSERT INTO t VALUES (1,0),(1,0),(1,0);
      EXPLAIN INSERT INTO t SELECT 1 QUERY;
      

      10.7.0 1bc82aaf0a7746c0921a94034aff2d51f0d75cd0 (Optimized)

      mysqld: ../nptl/pthread_mutex_lock.c:81: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.
      

      10.7.0 1bc82aaf0a7746c0921a94034aff2d51f0d75cd0 (Optimized)

      Core was generated by `/test/MD040921-mariadb-10.7.0-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x14cf14074700 (LWP 590265))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014cf15e34859 in __GI_abort () at abort.c:79
      #2  0x000014cf15e34729 in __assert_fail_base (fmt=0x14cf15fca588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x14cf1635262d "mutex->__data.__owner == 0", file=0x14cf163525fa "../nptl/pthread_mutex_lock.c", line=81, function=<optimized out>) at assert.c:92
      #3  0x000014cf15e45f36 in __GI___assert_fail (assertion=assertion@entry=0x14cf1635262d "mutex->__data.__owner == 0", file=file@entry=0x14cf163525fa "../nptl/pthread_mutex_lock.c", line=line@entry=81, function=function@entry=0x14cf16352790 <__PRETTY_FUNCTION__.10174> "__pthread_mutex_lock") at assert.c:101
      #4  0x000014cf16346164 in __GI___pthread_mutex_lock (mutex=mutex@entry=0x14cebc04f1d0) at ../nptl/pthread_mutex_lock.c:81
      #5  0x00005577731e5e77 in psi_mutex_lock (that=that@entry=0x14cebc04f1d0, file=file@entry=0x14cf00f232a0 "/test/10.7_opt/storage/spider/spd_db_conn.cc", line=line@entry=6727) at /test/10.7_opt/mysys/my_thr_init.c:489
      #6  0x000014cf00e6ddca in inline_mysql_mutex_lock (src_file=0x14cf00f232a0 "/test/10.7_opt/storage/spider/spd_db_conn.cc", src_line=6727, that=0x14cebc04f1d0) at /test/10.7_opt/include/mysql/psi/mysql_thread.h:746
      #7  spider_db_bulk_insert (spider=spider@entry=0x14cebc022fd0, table=0x14cebc029008, copy_info=copy_info@entry=0x14cebc0233c0, bulk_end=bulk_end@entry=true) at /test/10.7_opt/storage/spider/spd_db_conn.cc:6727
      #8  0x000014cf00eda474 in ha_spider::end_bulk_insert (this=0x14cebc022fd0) at /test/10.7_opt/storage/spider/ha_spider.cc:9896
      #9  ha_spider::end_bulk_insert (this=0x14cebc022fd0) at /test/10.7_opt/storage/spider/ha_spider.cc:9887
      #10 0x00005577732e697d in select_insert::abort_result_set (this=0x14cebc011cf8) at /test/10.7_opt/sql/sql_insert.cc:4294
      #11 0x000055777332c966 in mysql_execute_command (thd=0x14cebc000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.7_opt/sql/sql_parse.cc:4735
      #12 0x0000557773319456 in mysql_parse (thd=0x14cebc000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.7_opt/sql/sql_parse.cc:8036
      #13 0x0000557773325345 in dispatch_command (command=COM_QUERY, thd=0x14cebc000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.7_opt/sql/sql_class.h:1358
      #14 0x0000557773327217 in do_command (thd=0x14cebc000c58, blocking=blocking@entry=true) at /test/10.7_opt/sql/sql_parse.cc:1404
      #15 0x0000557773442ae7 in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /test/10.7_opt/sql/sql_connect.cc:1418
      #16 0x0000557773442e2d in handle_one_connection (arg=arg@entry=0x55777596e548) at /test/10.7_opt/sql/sql_connect.cc:1312
      #17 0x0000557773796298 in pfs_spawn_thread (arg=0x557775e10f78) at /test/10.7_opt/storage/perfschema/pfs.cc:2201
      #18 0x000014cf16343609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #19 0x000014cf15f31293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      In debug builds this testcase leads to the stack seen in MDEV-26582:

      10.7.0 1bc82aaf0a7746c0921a94034aff2d51f0d75cd0 (Debug)

      Core was generated by `/test/MD040921-mariadb-10.7.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x00001455e60bb248 in spider_db_bulk_insert (
          spider=spider@entry=0x1455c402d250, table=0x1455c405fb08, 
          copy_info=copy_info@entry=0x1455c402d640, bulk_end=bulk_end@entry=true)
          at /test/10.7_dbg/storage/spider/spd_db_conn.cc:6708
      [Current thread is 1 (Thread 0x1455f4053700 (LWP 572880))]
      (gdb) bt
      #0  0x00001455e60bb248 in spider_db_bulk_insert (spider=spider@entry=0x1455c402d250, table=0x1455c405fb08, copy_info=copy_info@entry=0x1455c402d640, bulk_end=bulk_end@entry=true) at /test/10.7_dbg/storage/spider/spd_db_conn.cc:6708
      #1  0x00001455e612c77a in ha_spider::end_bulk_insert (this=0x1455c402d250) at /test/10.7_dbg/storage/spider/ha_spider.cc:9896
      #2  0x0000561a3677cd66 in handler::ha_end_bulk_insert (this=0x1455c402d250) at /test/10.7_dbg/sql/handler.cc:4990
      #3  0x0000561a364252fe in select_insert::abort_result_set (this=0x1455c40151d8) at /test/10.7_dbg/sql/sql_insert.cc:4294
      #4  0x0000561a36479882 in mysql_execute_command (thd=thd@entry=0x1455c4000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.7_dbg/sql/sql_parse.cc:4735
      #5  0x0000561a36463ccb in mysql_parse (thd=thd@entry=0x1455c4000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1455f4052400) at /test/10.7_dbg/sql/sql_parse.cc:8036
      #6  0x0000561a364728d0 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1455c4000db8, packet=packet@entry=0x1455c400b739 "EXPLAIN INSERT INTO t SELECT 1 QUERY", packet_length=packet_length@entry=36, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_class.h:1358
      #7  0x0000561a36475cd6 in do_command (thd=0x1455c4000db8, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_parse.cc:1404
      #8  0x0000561a365ec0c8 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x561a39df3608, put_in_cache=put_in_cache@entry=true) at /test/10.7_dbg/sql/sql_connect.cc:1418
      #9  0x0000561a365ec6cd in handle_one_connection (arg=arg@entry=0x561a39df3608) at /test/10.7_dbg/sql/sql_connect.cc:1312
      #10 0x0000561a36a55ade in pfs_spawn_thread (arg=0x561a39cf2348) at /test/10.7_dbg/storage/perfschema/pfs.cc:2201
      #11 0x000014560a5e3609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #12 0x000014560a1d1293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.5.13 (dbg), 10.5.13 (opt), 10.6.5 (dbg), 10.6.5 (opt), 10.7.0 (dbg), 10.7.0 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.41 (dbg), 10.2.41 (opt), 10.3.32 (dbg), 10.3.32 (opt), 10.4.22 (dbg), 10.4.22 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.35 (dbg), 5.7.35 (opt), 8.0.26 (dbg), 8.0.26 (opt)

      Attachments

        Issue Links

          Activity

            People

              nayuta-yanagisawa Nayuta Yanagisawa (Inactive)
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.