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

safe_mutex: Trying to destroy a mutex l_perm->lock that was locked

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      Observed during a multi-thread test run of patch v5 (bb-12.0-mdev-34680-hf at 27ce95f3a483e416b355e741fd07e361d5b892d0):

      MDEV-34680-5 CS 12.1.0 27ce95f3a483e416b355e741fd07e361d5b892d0 (Debug, Clang) Build 01/08/2025

      ...
      250801 16:12:04 server_audit: Log file buffer size was changed to '8192'.
      250801 16:12:04 server_audit: Log file buffer size was changed to '0'.
      250801 16:12:04 server_audit: logging started to the file server_audit.log.
      250801 16:12:04 server_audit: Log file buffer size was changed to '8192'.
      safe_mutex: Trying to destroy a mutex l_perm->lock that was locked at /test/bb-12.0-mdev-34680-hf_dbg/mysys/file_logger.c, line 244 at /test/bb-12.0-mdev-34680-hf_dbg/mysys/file_logger.c, line 113
      

      MDEV-34680-5 CS 12.1.0 27ce95f3a483e416b355e741fd07e361d5b892d0 (Debug, Clang) Build 01/08/2025

      Core was generated by `/test/MDEV-34680_5_MD010825-mariadb-12.1.0-linux-x86_64-dbg/bin/mariadbd --no-d'.
      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 2211327)]
      (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  0x00007c4531e4526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007c4531e288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000062fe60ddea6d in safe_mutex_destroy (mp=0x7c4374025100, file=0x62fe5f72ba81 "/test/bb-12.0-mdev-34680-hf_dbg/mysys/file_logger.c", line=113) at /test/bb-12.0-mdev-34680-hf_dbg/mysys/thr_mutex.c:597
      #6  0x000062fe60df9983 in inline_mysql_mutex_destroy (that=0x7c4374025100, src_file=0x62fe5f72ba81 "/test/bb-12.0-mdev-34680-hf_dbg/mysys/file_logger.c", src_line=113)at /test/bb-12.0-mdev-34680-hf_dbg/include/mysql/psi/mysql_thread.h:724
      #7  0x000062fe60df9901 in logger_close (log=0x7c4374024d58)at /test/bb-12.0-mdev-34680-hf_dbg/mysys/file_logger.c:113
      #8  0x00007c453201ed1e in stop_logging ()at /test/bb-12.0-mdev-34680-hf_dbg/plugin/server_audit/server_audit.c:1042
      #9  0x00007c453201f8b4 in update_logging (thd=0x7c4394000d58, var=0x7c4532023690 <mysql_sysvar_logging>, var_ptr=0x7c4532024470 <logging>, save=0x7c4394015c48)at /test/bb-12.0-mdev-34680-hf_dbg/plugin/server_audit/server_audit.c:3049
      #10 0x000062fe60378360 in sys_var_pluginvar::global_update (this=0x7c43e4053810, thd=0x7c4394000d58, var=0x7c4394015c28)at /test/bb-12.0-mdev-34680-hf_dbg/sql/sql_plugin.cc:3691
      #11 0x000062fe6012b20a in sys_var::update (this=0x7c43e4053810, thd=0x7c4394000d58, var=0x7c4394015c28)at /test/bb-12.0-mdev-34680-hf_dbg/sql/set_var.cc:211
      #12 0x000062fe6012d524 in set_var::update (this=0x7c4394015c28, thd=0x7c4394000d58) at /test/bb-12.0-mdev-34680-hf_dbg/sql/set_var.cc:871
      #13 0x000062fe6012d068 in sql_set_variables (thd=0x7c4394000d58, var_list=0x7c4394006140, free=true)at /test/bb-12.0-mdev-34680-hf_dbg/sql/set_var.cc:752
      #14 0x000062fe60340db3 in mysql_execute_command (thd=0x7c4394000d58, is_called_from_prepared_stmt=false)at /test/bb-12.0-mdev-34680-hf_dbg/sql/sql_parse.cc:4859
      #15 0x000062fe60334bd4 in mysql_parse (thd=0x7c4394000d58, rawbuf=0x7c4394015a00 "SET GLOBAL server_audit_logging=OFF", length=35, parser_state=0x7c44df686a10)at /test/bb-12.0-mdev-34680-hf_dbg/sql/sql_parse.cc:7884
      #16 0x000062fe60331fa8 in dispatch_command (command=COM_QUERY, thd=0x7c4394000d58, packet=0x7c439400b309 "SET GLOBAL server_audit_logging=OFF;", packet_length=36, blocking=true)at /test/bb-12.0-mdev-34680-hf_dbg/sql/sql_parse.cc:1877
      #17 0x000062fe60335783 in do_command (thd=0x7c4394000d58, blocking=true)at /test/bb-12.0-mdev-34680-hf_dbg/sql/sql_parse.cc:1416
      #18 0x000062fe60553289 in do_handle_one_connection (connect=0x62fe642cd5a8, put_in_cache=true)at /test/bb-12.0-mdev-34680-hf_dbg/sql/sql_connect.cc:1414
      #19 0x000062fe6055302e in handle_one_connection (arg=0x62fe642cd5a8)at /test/bb-12.0-mdev-34680-hf_dbg/sql/sql_connect.cc:1326
      #20 0x00007c4531e9ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #21 0x00007c4531f29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      The issue is reducing, but reduction is extremely slow, the bug seems highly sporadic/hard to trigger. Perhaps a non-covered/leftover codepath of MDEV-4773?

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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