Audit log crashes on queries which contain special characters

Bug #1636410 reported by Roel Van de Paar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.6
New
Undecided
Unassigned
5.7
Triaged
High
Vlad Lesin

Bug Description

+bt
#0 0x00007fcabf272741 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1 0x00000000018429a4 in my_write_core (sig=6) at /git/tokudb-pfs1_dbg/mysys/stacktrace.c:247
#2 0x0000000000e7c80f in handle_fatal_signal (sig=6) at /git/tokudb-pfs1_dbg/sql/signal_handler.cc:223
#3 <signal handler called>
#4 0x00007fcabd6095f7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5 0x00007fcabd60ace8 in __GI_abort () at abort.c:90
#6 0x00007fcabd602566 in __assert_fail_base (fmt=0x7fcabd752ce8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7fcab05f9a84 "errors == 0", file=file@entry=0x7fcab05f9740 "/git/tokudb-pfs1_dbg/plugin/audit_log/audit_log.c", line=line@entry=512, function=function@entry=0x7fcab05fa690 <__PRETTY_FUNCTION__.12477> "audit_log_general_record") at assert.c:92
#7 0x00007fcabd602612 in __GI___assert_fail (assertion=0x7fcab05f9a84 "errors == 0", file=0x7fcab05f9740 "/git/tokudb-pfs1_dbg/plugin/audit_log/audit_log.c", line=512, function=0x7fcab05fa690 <__PRETTY_FUNCTION__.12477> "audit_log_general_record") at assert.c:101
#8 0x00007fcab05f47bc in audit_log_general_record (buf=0x7fcabf85df70 "SELECT INSERT(C1,4,2,'彴?啊')FROM T3ost []", buflen=4096, name=0x20477db "Query", t=1477384273, status=1046, event=0x7fcabf85f0a0, default_db=0x7fca794223a9 "", outlen=0x7fcabf85df68) at /git/tokudb-pfs1_dbg/plugin/audit_log/audit_log.c:512
#9 0x00007fcab05f5da7 in audit_log_notify (thd=0x7fca79419000, event_class=MYSQL_AUDIT_GENERAL_CLASS, event=0x7fcabf85f0a0) at /git/tokudb-pfs1_dbg/plugin/audit_log/audit_log.c:1049
#10 0x0000000000e7e6df in plugins_dispatch (thd=0x7fca79419000, plugin=0x7fca7942e2a0, arg=0x7fcabf85f040) at /git/tokudb-pfs1_dbg/sql/sql_audit.cc:1231
#11 0x0000000000e7e827 in event_class_dispatch (thd=0x7fca79419000, event_class=MYSQL_AUDIT_GENERAL_CLASS, event=0x7fcabf85f0a0) at /git/tokudb-pfs1_dbg/sql/sql_audit.cc:1294
#12 0x0000000000e7d097 in mysql_audit_notify (thd=0x7fca79419000, subclass=MYSQL_AUDIT_GENERAL_STATUS, error_code=1046, msg=0x20477db "Query", msg_len=5) at /git/tokudb-pfs1_dbg/sql/sql_audit.cc:327
#13 0x000000000150ea1c in mysql_audit_general (thd=0x7fca79419000, event_subtype=MYSQL_AUDIT_GENERAL_STATUS, error_code=1046, msg=0x20477db "Query") at /git/tokudb-pfs1_dbg/sql/sql_audit.h:93
#14 0x0000000001513d5f in dispatch_command (thd=0x7fca79419000, com_data=0x7fcabf85fc90, command=COM_QUERY) at /git/tokudb-pfs1_dbg/sql/sql_parse.cc:1874
#15 0x0000000001511815 in do_command (thd=0x7fca79419000) at /git/tokudb-pfs1_dbg/sql/sql_parse.cc:1010
#16 0x000000000164bdb8 in handle_connection (arg=0x7fca9cb4b0d0) at /git/tokudb-pfs1_dbg/sql/conn_handler/connection_handler_per_thread.cc:312
#17 0x0000000001871878 in pfs_spawn_thread (arg=0x7fcab3390720) at /git/tokudb-pfs1_dbg/storage/perfschema/pfs.cc:2188
#18 0x00007fcabf26ddc5 in start_thread (arg=0x7fcabf860700) at pthread_create.c:308
#19 0x00007fcabd6caced in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

This is happening in the TokuDB PFS tree. Not sure if there is any connection, though this is a new 'all over' crash and thus a qablocker. A workaround may be to disable audit plugin, will try.

Tags: audit qa qablock
Revision history for this message
Roel Van de Paar (roel11) wrote :

tokupfs1-PS241016-percona-server-5.7.14-7-linux-x86_64-debug

Revision history for this message
Roel Van de Paar (roel11) wrote :

An example testcase

# mysqld options required for replay: --init-file=/home/roel/percona-qa/plugins_57.sql
DROP DATABASE test;
SET NAMES gbk;
SELECT INSERT(�ã�,4,2,'������')FROM �ԣ�;

To avoid not being able to replay the testcases due to character conversion issues, will upload 3 different testcases below.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

This is likely not TokuDB-related. Please check without TokuDB, and if it still crashes, ask Sergei to take a look

Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

duplicate of bug 1614439?

Revision history for this message
Roel Van de Paar (roel11) wrote :
Revision history for this message
Roel Van de Paar (roel11) wrote :
Revision history for this message
Roel Van de Paar (roel11) wrote :
Revision history for this message
Roel Van de Paar (roel11) wrote :

Likely, yes. Thank you

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.