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

Audit log mutex locking issue upon changing server_audit_file_buffer_size, UBSAN null-pointer-use in logger_sync

    XMLWordPrintable

Details

    • Not for Release Notes
    • Q3/2025 Maintenance

    Description

      INSTALL PLUGIN server_audit SONAME 'server_audit';
      SET GLOBAL server_audit_logging=ON;
      SET GLOBAL server_audit_output_type=0;
      SET GLOBAL init_slave="none";
      CHANGE MASTER TO master_host='0.0.0.0';
      START SLAVE;
      SET GLOBAL server_audit_file_buffer_size=0;
      

      Leads to:

      bb-12.0-mdev-34680x2-hf CS 12.0.1 4db190845cda3598c35416a40955566b114b26e4 (Optimized, Clang) Build 24/06/2025

      Core was generated by `/test/bb-12.0-mdev-34680x2-hf_MD240625-mariadb-12.0.1-linux-x86_64-opt/bin/mari'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  inline_mysql_mutex_lock (that=0x328, src_line=244, src_file=<optimized out>)at /test/bb-12.0-mdev-34680x2-hf_opt/include/mysql/psi/mysql_thread.h:745
       
      [Current thread is 1 (LWP 4023892)]
      (gdb) bt
      #0  inline_mysql_mutex_lock (that=0x328, src_line=244, src_file=<optimized out>)at /test/bb-12.0-mdev-34680x2-hf_opt/include/mysql/psi/mysql_thread.h:745
      #1  logger_sync (log=0x0)at /test/bb-12.0-mdev-34680x2-hf_opt/mysys/file_logger.c:244
      #2  0x00007b0f80e0fac0 in log_statement_ex (cn=cn@entry=0x7b0e2800b608, ev_time=1751284361, thd_id=<optimized out>, query=<optimized out>, query_len=<optimized out>, error_code=1064, type=<optimized out>, take_lock=1)at /test/bb-12.0-mdev-34680x2-hf_opt/plugin/server_audit/server_audit.c:1881
      #3  0x00007b0f80e0db2b in log_statement (cn=0x0, cn@entry=0x7b0e2800b608, event=event@entry=0x7b0f808b19c8, type=<optimized out>)at /test/bb-12.0-mdev-34680x2-hf_opt/plugin/server_audit/server_audit.c:1895
      #4  0x00007b0f80e0d522 in auditing (thd=<optimized out>, event_class=0, ev=0x7b0f808b19c8)at /test/bb-12.0-mdev-34680x2-hf_opt/plugin/server_audit/server_audit.c:2191
      #5  0x0000565eaa4374f7 in plugins_dispatch (thd=0x7b0e28001028, plugin=<optimized out>, arg=0x7b0f808b1980)at /test/bb-12.0-mdev-34680x2-hf_opt/sql/sql_audit.cc:398
      #6  mysql_audit_notify (thd=thd@entry=0x7b0e28001028, event_class=event_class@entry=0, event=event@entry=0x7b0f808b19c8)at /test/bb-12.0-mdev-34680x2-hf_opt/sql/sql_audit.cc:437
      #7  0x0000565eaa2e53ad in mysql_audit_general (thd=thd@entry=0x7b0e28001028, event_subtype=event_subtype@entry=3, error_code=<optimized out>, msg=<optimized out>)at /test/bb-12.0-mdev-34680x2-hf_opt/sql/sql_audit.h:212
      #8  0x0000565eaa2e2c47 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7b0e28001028, packet=<optimized out>, packet@entry=0x7b0e28011460 "none", packet_length=packet_length@entry=4, blocking=<optimized out>)at /test/bb-12.0-mdev-34680x2-hf_opt/sql/sql_parse.cc:2435
      #9  0x0000565eaa2e12ef in execute_init_command (thd=0x7b0e28001028, init_command=<optimized out>, var_lock=<optimized out>)at /test/bb-12.0-mdev-34680x2-hf_opt/sql/sql_parse.cc:965
      #10 0x0000565eaa1c8945 in handle_slave_sql (arg=arg@entry=0x565eac7e31a0)at /test/bb-12.0-mdev-34680x2-hf_opt/sql/slave.cc:5396
      #11 0x0000565eaa5f5459 in pfs_spawn_thread (arg=0x7b0e30038738)at /test/bb-12.0-mdev-34680x2-hf_opt/storage/perfschema/pfs.cc:2198
      #12 0x00007b0f86c9ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #13 0x00007b0f86d29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      bb-12.0-mdev-34680x2-hf CS 12.0.1 4db190845cda3598c35416a40955566b114b26e4 (Debug, Clang) Build 24/06/2025

      Core was generated by `/test/bb-12.0-mdev-34680x2-hf_MD240625-mariadb-12.0.1-linux-x86_64-dbg/bin/mari'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x00005e216d5c0fd5 in safe_mutex_lock (mp=0x3a8, my_flags=0, file=0x5e216bf9a238 "/test/bb-12.0-mdev-34680x2-hf_dbg/mysys/file_logger.c", line=244) at /test/bb-12.0-mdev-34680x2-hf_dbg/mysys/thr_mutex.c:231
       
      [Current thread is 1 (LWP 269587)]
      (gdb) bt
      #0  0x00005e216d5c0fd5 in safe_mutex_lock (mp=0x3a8, my_flags=0, file=0x5e216bf9a238 "/test/bb-12.0-mdev-34680x2-hf_dbg/mysys/file_logger.c", line=244) at /test/bb-12.0-mdev-34680x2-hf_dbg/mysys/thr_mutex.c:231
      #1  0x00005e216d5dd4d7 in inline_mysql_mutex_lock (that=0x3a8, src_file=0x5e216bf9a238 "/test/bb-12.0-mdev-34680x2-hf_dbg/mysys/file_logger.c", src_line=244)at /test/bb-12.0-mdev-34680x2-hf_dbg/include/mysql/psi/mysql_thread.h:750
      #2  0x00005e216d5dd99f in logger_sync (log=0x0)at /test/bb-12.0-mdev-34680x2-hf_dbg/mysys/file_logger.c:244
      #3  0x00007d31b940fb95 in log_statement_ex (cn=0x7d310001a168, ev_time=1751284581, thd_id=6, query=0x7d310000fff8 "none", query_len=4, error_code=1064, type=0x7d31b94091c3 "QUERY", take_lock=1)at /test/bb-12.0-mdev-34680x2-hf_dbg/plugin/server_audit/server_audit.c:1881
      #4  0x00007d31b940cbf5 in log_statement (cn=0x7d310001a168, event=0x7d31b8e9a4b0, type=0x7d31b94091c3 "QUERY")at /test/bb-12.0-mdev-34680x2-hf_dbg/plugin/server_audit/server_audit.c:1895
      #5  0x00007d31b940bdcc in auditing (thd=0x7d3100001b18, event_class=0, ev=0x7d31b8e9a4b0)at /test/bb-12.0-mdev-34680x2-hf_dbg/plugin/server_audit/server_audit.c:2191
      #6  0x00005e216cd3ff11 in plugins_dispatch (thd=0x7d3100001b18, plugin=0x7d310001c4f8, arg=0x7d31b8e9a460)at /test/bb-12.0-mdev-34680x2-hf_dbg/sql/sql_audit.cc:398
      #7  0x00005e216cd3fe60 in mysql_audit_notify (thd=0x7d3100001b18, event_class=0, event=0x7d31b8e9a4b0)at /test/bb-12.0-mdev-34680x2-hf_dbg/sql/sql_audit.cc:437
      #8  0x00005e216cb278c8 in mysql_audit_general (thd=0x7d3100001b18, event_subtype=3, error_code=1064, msg=0x5e216bf58796 "Query")at /test/bb-12.0-mdev-34680x2-hf_dbg/sql/sql_audit.h:212
      #9  0x00005e216cb245ec in dispatch_command (command=COM_QUERY, thd=0x7d3100001b18, packet=0x7d310000fff0 "none", packet_length=4, blocking=true) at /test/bb-12.0-mdev-34680x2-hf_dbg/sql/sql_parse.cc:2435
      #10 0x00005e216cb21711 in execute_init_command (thd=0x7d3100001b18, init_command=0x5e216dc73e50 <opt_init_slave>, var_lock=0x5e216dc77780 <LOCK_sys_init_slave>)at /test/bb-12.0-mdev-34680x2-hf_dbg/sql/sql_parse.cc:965
      #11 0x00005e216c927dbe in handle_slave_sql (arg=0x5e216fe531e0)at /test/bb-12.0-mdev-34680x2-hf_dbg/sql/slave.cc:5396
      #12 0x00007d31c049ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #13 0x00007d31c0529c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      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:
                Resolved:

                Git Integration

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