Comment 7 for bug 1435606

Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote : Re: Installation of audit_log plugin crashes mysql server

This is easy to confirm:

[root@centos openxs]# mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.23-72.1-log Percona Server (GPL), Release 72.1, Revision 0503478

Copyright (c) 2009-2015 Percona LLC and/or its affiliates
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> INSTALL PLUGIN audit_log SONAME 'audit_log.so'
    -> ;
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> exit
Bye

In the error log we see:

...
2015-03-24 10:01:49 3126 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.23-72.1-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 Percona Server (GPL), Release 72.1, Revision 0503478
2015-03-24T08:03:01 audit_log: Cannot open file /var/log/mysql-audit.log. Error: : Permission denied
2015-03-24 10:03:01 3126 [ERROR] Plugin 'audit_log' init function returned error.
2015-03-24 10:03:01 3126 [ERROR] Plugin 'audit_log' registration as a AUDIT failed.
2015-03-24 10:03:01 3126 [Note] Shutting down plugin 'audit_log'
08:03:01 UTC - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Please help us make Percona Server better by reporting any
bugs at http://bugs.percona.com/

key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=1
max_threads=153
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 69184 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7f02ec7f9000
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7f031d3a1d00 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x2c)[0x8cc59c]
/usr/sbin/mysqld(handle_fatal_signal+0x461)[0x654f11]
/lib64/libpthread.so.0(+0xf710)[0x7f031cdb6710]
/usr/lib64/mysql/plugin/audit_log.so(+0x34b7)[0x7f02f491d4b7]
/usr/sbin/mysqld(_Z21finalize_audit_pluginP13st_plugin_int+0x1f)[0x684d6f]
/usr/sbin/mysqld[0x6e45c7]
/usr/sbin/mysqld(_Z20mysql_install_pluginP3THDPK19st_mysql_lex_stringS3_+0x5de)[0x6e587e]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x101c)[0x6d587c]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x5c8)[0x6db7e8]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xff9)[0x6dcf59]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0x162)[0x6aa772]
/usr/sbin/mysqld(handle_one_connection+0x40)[0x6aa860]
/usr/sbin/mysqld(pfs_spawn_thread+0x143)[0xadc113]
/lib64/libpthread.so.0(+0x79d1)[0x7f031cdae9d1]
/lib64/libc.so.6(clone+0x6d)[0x7f031b4c88fd]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f02f372f010): is an invalid pointer
Connection ID (thread ID): 2
Status: NOT_KILLED

You may download the Percona Server operations manual by visiting
http://www.percona.com/software/percona-server/. You may find information
in the manual which will help you identify the cause of the crash.
Writing a core file

If you care, this is what I added to the /etc/my.cnf before running INSTALL PLUGIN:

# audit_log plugin options
audit-log = FORCE_PLUS_PERMANENT
audit_log_file = /var/log/mysql-audit.log
audit_log_format = JSON
audit_log_strategy = SEMISYNCHRONOUS
plugin-load = audit_log.so

[root@centos openxs]# ls -l /var/log/mysql*
-rw-r-----. 1 mysql root 1478478 Mar 24 10:03 /var/log/mysqld.log