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

safe_mutex: Trying to lock uninitialized mutex at /data/src/10.4-bug/sql/rpl_parallel.cc, line 470 upon shutdown during FTWRL

    XMLWordPrintable

Details

    Description

      10.5 87a7968c

      2020-04-14 10:14:49 0 [Note] /ten1/builds/10.5-87a7968c-deb/bin/mysqld (initiated by: root[root] @ localhost [127.0.0.1]): Normal shutdown
      2020-04-14 10:14:49 0 [Note] Event Scheduler: Purging the queue. 14 events
      safe_mutex: Trying to lock uninitialized mutex at /home/elenst/src/10.5/sql/rpl_parallel.cc, line 470
      200414 10:14:49 [ERROR] mysqld got signal 6 ;
       
      #3  <signal handler called>
      #4  0x00007f73a1ad5207 in raise () from /lib64/libc.so.6
      #5  0x00007f73a1ad68f8 in abort () from /lib64/libc.so.6
      #6  0x0000560ad0f8b4cf in safe_mutex_lock (mp=0x560ad1f58d90 <global_rpl_thread_pool+16>, my_flags=0, file=0x560ad11aaf40 "/home/elenst/src/10.5/sql/rpl_parallel.cc", line=470) at /home/elenst/src/10.5/mysys/thr_mutex.c:244
      #7  0x0000560ad05107d1 in inline_mysql_mutex_lock (that=0x560ad1f58d90 <global_rpl_thread_pool+16>, src_file=0x560ad11aaf40 "/home/elenst/src/10.5/sql/rpl_parallel.cc", src_line=470) at /home/elenst/src/10.5/include/mysql/psi/mysql_thread.h:763
      #8  0x0000560ad051229d in pool_mark_busy (pool=0x560ad1f58d80 <global_rpl_thread_pool>, thd=0x7f7328000b18) at /home/elenst/src/10.5/sql/rpl_parallel.cc:470
      #9  0x0000560ad05126f2 in rpl_pause_for_ftwrl (thd=0x7f7328000b18) at /home/elenst/src/10.5/sql/rpl_parallel.cc:563
      #10 0x0000560ad02eb534 in mysql_execute_command (thd=0x7f7328000b18) at /home/elenst/src/10.5/sql/sql_parse.cc:5374
      #11 0x0000560ad02f3912 in mysql_parse (thd=0x7f7328000b18, rawbuf=0x7f7328012460 "FLUSH /* QNO 1411 CON_ID 9 */ TABLES WITH READ LOCK", length=51, parser_state=0x7f7384acf520, is_com_multi=false, is_next_command=false) at /home/elenst/src/10.5/sql/sql_parse.cc:7953
      #12 0x0000560ad02df2c0 in dispatch_command (command=COM_QUERY, thd=0x7f7328000b18, packet=0x7f7328008809 "FLUSH /* QNO 1411 CON_ID 9 */ TABLES WITH READ LOCK", packet_length=51, is_com_multi=false, is_next_command=false) at /home/elenst/src/10.5/sql/sql_parse.cc:1840
      #13 0x0000560ad02dd93c in do_command (thd=0x7f7328000b18) at /home/elenst/src/10.5/sql/sql_parse.cc:1359
      #14 0x0000560ad0483c6d in do_handle_one_connection (connect=0x560ad51db8f8, put_in_cache=true) at /home/elenst/src/10.5/sql/sql_connect.cc:1422
      #15 0x0000560ad0483986 in handle_one_connection (arg=0x560ad51db8f8) at /home/elenst/src/10.5/sql/sql_connect.cc:1319
      #16 0x0000560ad09c173e in pfs_spawn_thread (arg=0x560ad52f7448) at /home/elenst/src/10.5/storage/perfschema/pfs.cc:2201
      #17 0x00007f73a310bdd5 in start_thread () from /lib64/libpthread.so.0
      #18 0x00007f73a1b9cead in clone () from /lib64/libc.so.6
      

      The stack trace above is from an original failure in concurrent tests.

      The test case below will produce a failure with line numbers in rpl_parallel.cc shifted by 1, due to the suggested debug injection.
      Theoretically it can fail without the injection, but chances are slim, while with it it fails for me every time.

      injection

      index 9344312fe62..e42e6b2ebb5 100644
      --- a/sql/rpl_parallel.cc
      +++ b/sql/rpl_parallel.cc
      @@ -467,6 +467,7 @@ pool_mark_busy(rpl_parallel_thread_pool *pool, THD *thd)
           So we protect the infrequent operations of FLUSH TABLES WITH READ LOCK and
           pool size changes with this condition wait.
         */
      +  DBUG_EXECUTE_IF("sleep_mark_busy",my_sleep(1000000););
         mysql_mutex_lock(&pool->LOCK_rpl_thread_pool);
         if (thd)
         {
      

      Test case

      --connect (con1,localhost,root,,)
      SET DEBUG_DBUG='+d,sleep_mark_busy';
      --send
        FLUSH TABLES WITH READ LOCK;
       
      --connection default
      --source include/restart_mysqld.inc
      

      Reproducible on 10.4, 10.5.
      Could not reproduce and didn't observe on 10.3.
      I have no information if the problem has any effect on non-debug builds.

      Attachments

        Issue Links

          Activity

            People

              sachin.setiya.007 Sachin Setiya (Inactive)
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.