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

Audit: server crashes on concurrent setting of output_type and DML

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      I've set Priority to Minor, despite it being a crash, because I don't think it's so important to be able to change the output type at runtime - I find it unlikely that many people will have the urgent need to switch from a regular file to syslog and vice versa. Thus, unless there is a specific requirement to keep the variable dynamic, I think it should be acceptable to solve the problem (and prevent more in future) by making it read-only at runtime

      safe_mutex: Trying to destroy a mutex l_perm->lock that was locked at 5.5-noga-hf/mysys/file_logger.c, line 176 at 5.5-noga-hf/mysys/
      file_logger.c, line 95
      130709 20:25:45 [ERROR] mysqld got signal 6 ;

      #3  <signal handler called>
      #4  0x00007f332f541425 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
      #5  0x00007f332f544b8b in __GI_abort () at abort.c:91
      #6  0x0000000000cff6e5 in safe_mutex_lock (mp=0x7f32e00e8100, my_flags=0, file=0xeb6d28 "5.5-noga-hf/mysys/file_logger.c", line=176) at 5.5-noga-hf/mysys/thr_mutex.c:247
      #7  0x0000000000d102b4 in inline_mysql_mutex_lock (that=0x7f32e00e8100, src_file=0xeb6d28 "5.5-noga-hf/mysys/file_logger.c", src_line=176) at 5.5-noga-hf/include/mysql/psi/mysql_thread.h:618
      #8  0x0000000000d10a53 in logger_write (log=0x7f32e00e7ee0, buffer=0x7f332c15aad0 "20130709 20:11:05,ubuntu12-04,root[root] @ localhost [127.0.0.1],,12,QUERY,UPDATE `CC` SET `col_int_nokey` = 's',0\nit.lo\300\b", size=115) at 5.5-noga-hf/mysys/file_logger.c:176
      #9  0x00007f332c1f1c73 in write_log (message=0x7f332c15aad0 "20130709 20:11:05,ubuntu12-04,root[root] @ localhost [127.0.0.1],,12,QUERY,UPDATE `CC` SET `col_int_nokey` = 's',0\nit.lo\300\b", len=115) at 5.5-noga-hf/plugin/server_audit/server_audit.c:217
      #10 0x00007f332c1f1fe2 in log_statement (event=0x7f332c15b000, type=0x7f332c1f301e "QUERY") at 5.5-noga-hf/plugin/server_audit/server_audit.c:280
      #11 0x00007f332c1f25c7 in auditing (thd=0x4bd82a0, event_class=0, ev=0x7f332c15b000) at 5.5-noga-hf/plugin/server_audit/server_audit.c:383
      #12 0x0000000000718ad4 in plugins_dispatch (thd=0x4bd82a0, plugin=0x7f32d8004c10, arg=0x7f332c15afb0) at 5.5-noga-hf/sql/sql_audit.cc:504
      #13 0x0000000000718b7d in event_class_dispatch (thd=0x4bd82a0, event_class=0, event=0x7f332c15b000) at 5.5-noga-hf/sql/sql_audit.cc:540
      #14 0x0000000000717534 in general_class_handler(THD *, uint, typedef __va_list_tag __va_list_tag *) (thd=0x4bd82a0, event_subtype=3, ap=0x7f332c15b088) at 5.5-noga-hf/sql/sql_audit.cc:85
      #15 0x000000000071853d in mysql_audit_notify (thd=0x4bd82a0, event_class=0, event_subtype=3) at 5.5-noga-hf/sql/sql_audit.cc:234
      #16 0x000000000060e3f5 in mysql_audit_general (thd=0x4bd82a0, event_subtype=3, error_code=0, msg=0xd6e592 "Query") at 5.5-noga-hf/sql/sql_audit.h:142
      #17 0x0000000000611d18 in dispatch_command (command=COM_QUERY, thd=0x4bd82a0, packet=0x4bde351 "", packet_length=37) at 5.5-noga-hf/sql/sql_parse.cc:1455
      #18 0x000000000060fae7 in do_command (thd=0x4bd82a0) at 5.5-noga-hf/sql/sql_parse.cc:794
      #19 0x000000000071be9b in do_handle_one_connection (thd_arg=0x4bd82a0) at 5.5-noga-hf/sql/sql_connect.cc:1266
      #20 0x000000000071b882 in handle_one_connection (arg=0x4bd82a0) at 5.5-noga-hf/sql/sql_connect.cc:1181
      #21 0x00007f333030ae9a in start_thread (arg=0x7f332c15c700) at pthread_create.c:308

      bzr version-info

      revision-id: holyfoot@askmonty.org-20130705160101-ni574i35exft3wn5
      revno: 3825
      branch-nick: 5.5-noga-hf

      To reproduce,

      • start server with server_audit plugin on port 3306;
      • clone the latest lp:randgen tree;
      • cd randgen;
      • copy the grammar below into a.yy;
      • run the command line:

        perl ./gentest.pl --grammar=a.yy --threads=2 --duration=60 --dsn=dbi:mysql:host=127.0.0.1:port=3306:user=root:database=test --gendata

      RQG grammar (a.yy):

      query_init:
      	SET GLOBAL server_audit_file_path='my_audit.log' , server_audit_logging=1, server_audit_output_type=file ;
       
      thread1:
      	SET GLOBAL server_audit_output_type = syslog | SET GLOBAL server_audit_output_type = file ;
       
      query:
      	UPDATE _table SET _field_no_pk = value ;
       
      value:
      	_digit | _tinyint_unsigned | _varchar(1) | _int_unsigned ;

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.