Bug #84816 lock table write timeout cause server crash
Submitted: 4 Feb 2017 7:48 Modified: 7 Mar 2017 10:16
Reporter: zkong kong Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.6.12-debug OS:CentOS (7)
Assigned to: CPU Architecture:Any

[4 Feb 2017 7:48] zkong kong
Description:
my_vsnprintf_ex (cs=0x3793340 <my_charset_utf8_general_ci>, to=0x2b7f9b822790 "", n=512, fmt=0x2b7f9df63864 "Lock wait timeout exceeded; try restarting transaction: %-.256s",
    ap=0x2b7f9b822990) at /u01/kongzhi/alisql/strings/my_vsnprintf.c:542
#1  0x00000000013ece47 in my_error (nr=1205, MyFlags=0) at /u01/kongzhi/alisql/mysys/my_error.c:181
#2  0x0000000000d0d3da in MDL_context::acquire_lock (this=0x2b8434f8d0f0, mdl_request=0x2b844341f4a0, lock_wait_timeout=0) at /u01/kongzhi/alisql/sql/mdl.cc:2282
#3  0x0000000000d0e2fc in MDL_context::acquire_locks (this=0x2b8434f8d0f0, mdl_requests=0x2b7f9b822fb0, lock_wait_timeout=0) at /u01/kongzhi/alisql/sql/mdl.cc:2434
#4  0x0000000000dc6d51 in lock_table_names (thd=0x2b8434f8d000, tables_start=0x2b844341f0f8, tables_end=0x0, lock_wait_timeout=0, flags=0) at /u01/kongzhi/alisql/sql/sql_base.cc:4898
#5  0x0000000000dc743e in open_tables (thd=0x2b8434f8d000, start=0x2b7f9b8230f0, counter=0x2b7f9b82310c, flags=0, prelocking_strategy=0x2b7f9b823110)
    at /u01/kongzhi/alisql/sql/sql_base.cc:5075
#6  0x0000000000e9bf44 in lock_tables_open_and_lock_tables (thd=0x2b8434f8d000, tables=0x2b844341f0f8) at /u01/kongzhi/alisql/sql/sql_parse.cc:2684
#7  0x0000000000ea5478 in mysql_execute_command (thd=0x2b8434f8d000) at /u01/kongzhi/alisql/sql/sql_parse.cc:4481
#8  0x0000000000eb43b9 in mysql_parse (thd=0x2b8434f8d000, rawbuf=0x2b844341f010 "lock table t write no_wait", length=26, parser_state=0x2b7f9b8243e0)
    at /u01/kongzhi/alisql/sql/sql_parse.cc:7136
#9  0x0000000000e97313 in dispatch_command (command=COM_QUERY, thd=0x2b8434f8d000, packet=0x2b84512a0001 "lock table t write no_wait", packet_length=26)
    at /u01/kongzhi/alisql/sql/sql_parse.cc:1758
#10 0x0000000000e93f92 in do_command (thd=0x2b8434f8d000) at /u01/kongzhi/alisql/sql/sql_parse.cc:1138
#11 0x0000000000e25692 in do_handle_one_connection (thd_arg=0x2b8434f8d000) at /u01/kongzhi/alisql/sql/sql_connect.cc:1046
#12 0x0000000000e24c66 in handle_one_connection (arg=0x2b8434f8d000) at /u01/kongzhi/alisql/sql/sql_connect.cc:954
#13 0x00002b7f9baa8dc5 in start_thread () from /lib64/libpthread.so.0
#14 0x00002b7f9cf27ced in clone () from /lib64/libc.so.6

How to repeat:
create table t(id int);
session 1:
lock table t write;
session 2:
lock table t write no_wait;
[4 Feb 2017 18:29] MySQL Verification Team
Thank you for the bug report. Your version is quite older please test latest released version 5.6.35 and your test case causes syntax error in the command done in session 2?

mysql> lock table t write no_wait;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'no_wait' at line 1
mysql>
[7 Feb 2017 10:16] MySQL Verification Team
Thank you for the feedback. The error I showed I got with the version 5.6.12 so the current version released shows the same error for you?. Thanks.
[8 Mar 2017 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".