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

Trying to lock mutex when the mutex was already locked (session_tracker.cc), server hangs

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      SET session_track_system_variables="*";
       
      --error ER_NO_SUCH_TABLE
      ALTER TABLE t1 NOWAIT FORCE;
      USE mysql;
      

      10.5 5673cbe0941e105eb73b5ecf651a529f8e717b52

      safe_mutex: Trying to lock mutex at /data/bld/10.5-asan/sql/session_tracker.cc, line 431, when the mutex was already locked at /data/bld/10.5-asan/sql/session_tracker.cc, line 431 in thread T@19
      241005 23:09:38 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f0ccbe45472 in __GI_abort () at ./stdlib/abort.c:79
      #8  0x0000556b9755a278 in safe_mutex_lock (mp=0x556b99da0520 <LOCK_global_system_variables>, my_flags=0, file=0x556b977ddf40 "/data/bld/10.5-asan/sql/session_tracker.cc", line=431) at /data/bld/10.5-asan/mysys/thr_mutex.c:258
      #9  0x0000556b9541d69e in inline_mysql_mutex_lock (that=0x556b99da0520 <LOCK_global_system_variables>, src_file=0x556b977ddf40 "/data/bld/10.5-asan/sql/session_tracker.cc", src_line=431) at /data/bld/10.5-asan/include/mysql/psi/mysql_thread.h:750
      #10 0x0000556b9541fb50 in Session_sysvars_tracker::vars_list::store (this=0x62b000084300, thd=0x62b00007e218, buf=0x7f0cbc2f3350) at /data/bld/10.5-asan/sql/session_tracker.cc:431
      #11 0x0000556b9542023d in Session_sysvars_tracker::store (this=0x62b0000842f0, thd=0x62b00007e218, buf=0x7f0cbc2f3350) at /data/bld/10.5-asan/sql/session_tracker.cc:501
      #12 0x0000556b95422cbb in Session_tracker::store (this=0x62b000084290, thd=0x62b00007e218, buf=0x7f0cbc2f3350) at /data/bld/10.5-asan/sql/session_tracker.cc:1278
      #13 0x0000556b953fd505 in Protocol::net_send_ok (this=0x62b00007e818, thd=0x62b00007e218, server_status=16386, statement_warn_count=0, affected_rows=0, id=0, message=0x62b000083f73 "", is_eof=false, skip_flush=false) at /data/bld/10.5-asan/sql/protocol.cc:280
      #14 0x0000556b953ff56a in Protocol::send_ok (this=0x62b00007e818, server_status=16386, statement_warn_count=0, affected_rows=0, last_insert_id=0, message=0x62b000083f73 "", skip_flush=false) at /data/bld/10.5-asan/sql/protocol.cc:643
      #15 0x0000556b953ff0f1 in Protocol::end_statement (this=0x62b00007e818) at /data/bld/10.5-asan/sql/protocol.cc:607
      #16 0x0000556b956dba56 in dispatch_command (command=COM_QUERY, thd=0x62b00007e218, packet=0x62900026c219 "USE mysql", packet_length=9, is_com_multi=false, is_next_command=false) at /data/bld/10.5-asan/sql/sql_parse.cc:2485
      #17 0x0000556b956d48fa in do_command (thd=0x62b00007e218) at /data/bld/10.5-asan/sql/sql_parse.cc:1376
      #18 0x0000556b95b2df04 in do_handle_one_connection (connect=0x608000003a38, put_in_cache=true) at /data/bld/10.5-asan/sql/sql_connect.cc:1417
      #19 0x0000556b95b2d8c7 in handle_one_connection (arg=0x6080000039b8) at /data/bld/10.5-asan/sql/sql_connect.cc:1319
      #20 0x0000556b9678bc94 in pfs_spawn_thread (arg=0x61500000c898) at /data/bld/10.5-asan/storage/perfschema/pfs.cc:2201
      #21 0x00007f0ccbea8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #22 0x00007f0ccbf2861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Non-debug builds hang.

      The failure started happening after this commit:

      commit 9021f40b8ebfa9a9e0b01029a62742b7cdde5be5
      Author: Sergei Golubchik
      Date:   Mon Sep 30 18:08:00 2024 +0200
       
          MDEV-35050 Found wrong usage of mutex upon setting plugin session variables
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.