trellix-enterprise / mysql-audit

AUDIT Plugin for MySQL. See wiki and readme for description. If you find the plugin useful, please star us on GitHub. We love stars and it's a great way to show your feedback.
Other
239 stars 57 forks source link

Crash when setting variable to null #133

Closed blalor closed 8 years ago

blalor commented 8 years ago

The following caused a segfault:

{
  "query": "set global audit_record_cmds = null",
  "cmd": "set_option",
  "msg-type": "activity",
  "date": "1452104698186",
  "thread-id": "72309112",
  "query-id": "1022222598",
  "user": "superuser",
  "priv_user": "superuser",
  "host": "localhost",
  "ip": ""
}

Error log:

18:24:58 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.

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

Thread pointer: 0x2b399a60
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 = 7fd64b0c2e18 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x35)[0x8d9d85]
/usr/sbin/mysqld(handle_fatal_signal+0x494)[0x665344]
/lib64/libpthread.so.0(+0xf790)[0x7fddaa355790]
/lib64/libc.so.6(+0x134b7c)[0x7fdda9102b7c]
/usr/lib64/mysql/plugin/libaudit_plugin.so(+0xe8c7)[0x7fd64a45c8c7]
/usr/sbin/mysqld(_ZN17sys_var_pluginvar13global_updateEP3THDP7set_var+0x55)[0x6eeef5]
/usr/sbin/mysqld(_ZN7sys_var6updateEP3THDP7set_var+0x69)[0x664389]
/usr/sbin/mysqld(_ZN7set_var6updateEP3THD+0x17)[0x664917]
/usr/sbin/mysqld(_Z17sql_set_variablesP3THDP4ListI12set_var_baseE+0x89)[0x663b59]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x2390)[0x6e28f0]
/usr/lib64/mysql/plugin/libaudit_plugin.so(+0xc0fb)[0x7fd64a45a0fb]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x3b8)[0x6e5658]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x14ba)[0x6e6bca]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0xcf)[0x6b377f]
/usr/sbin/mysqld(handle_one_connection+0x47)[0x6b38a7]
/usr/sbin/mysqld(pfs_spawn_thread+0x12a)[0xafde1a]
/lib64/libpthread.so.0(+0x7a51)[0x7fddaa34da51]
/lib64/libc.so.6(clone+0x6d)[0x7fdda90b693d]

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

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
Writing a core file

Audit_version: 1.0.8-527

aharonrobbins commented 8 years ago

Thanks for the report. We will work on this.

aharonrobbins commented 8 years ago

The current code base (just pushed to github) has a fix for this issue. Thanks for reporting it.