[MDEV-17539] Assertion `0' failed in Protocol::end_statement() upon KILL_SERVER Created: 2018-10-24  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Prepared Statements, Server
Affects Version/s: 10.1, 10.2, 10.3, 10.4
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Dmitry Shulga
Resolution: Unresolved Votes: 0
Labels: None


 Description   

10.2 1ad79c81

2019-09-23  1:50:18 139912696772352 [Note] /data/bld/10.2-debug-nightly/bin/mysqld (initiated by: root[root] @ localhost [127.0.0.1]): Normal shutdown
mysqld: /data/src/10.2/sql/protocol.cc:598: void Protocol::end_statement(): Assertion `0' failed.
190923  1:50:18 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f400e189f12 in __GI___assert_fail (assertion=0x562ca44fc020 "0", file=0x562ca44fbdc0 "/data/src/10.2/sql/protocol.cc", line=598, function=0x562ca44fc870 <Protocol::end_statement()::__PRETTY_FUNCTION__> "void Protocol::end_statement()") at assert.c:101
#8  0x0000562ca39b668c in Protocol::end_statement (this=0x7f3f7c0010b8) at /data/src/10.2/sql/protocol.cc:598
#9  0x0000562ca3a7db1f in dispatch_command (command=COM_STMT_PREPARE, thd=0x7f3f7c000b00, packet=0x7f3f7c0087c1 "CREATE TABLE `D` LIKE `t9` /* QNO 19406 CON_ID 19 */ ", packet_length=53, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:2388
#10 0x0000562ca3a7a9c1 in do_command (thd=0x7f3f7c000b00) at /data/src/10.2/sql/sql_parse.cc:1384
#11 0x0000562ca3bcfb83 in do_handle_one_connection (connect=0x562ca6a32c80) at /data/src/10.2/sql/sql_connect.cc:1336
#12 0x0000562ca3bcf8ee in handle_one_connection (arg=0x562ca6a32c80) at /data/src/10.2/sql/sql_connect.cc:1241
#13 0x00007f400fcfe4a4 in start_thread (arg=0x7f3ff69be700) at pthread_create.c:456
#14 0x00007f400e246d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x0): 
Connection ID (thread ID): 19
Status: KILL_SERVER

To reproduce:

git clone https://github.com/MariaDB/randgen --branch mdev17539 rqg-mdev17539
cd rqg-mdev17539
perl ./runall-trials.pl --trials=10 --output='Protocol::end_statement' --grammar=mdev17539.yy --scenario=Restart --ps-protocol --threads=6 --duration=200 --gendata-advanced --vardir=/dev/shm/vardir --basedir=/data/bld/10.2

Remember to use your own basedir.
Reproducing might take a while. Currently the failure always happens for me within 10 attempts (as configured in the command line), but it can vary on different machines and builds. Increase the trials number if necessary.
Couldn't reproduce on 10.4.



 Comments   
Comment by Elena Stepanova [ 2019-12-09 ]

I've added another grammar to the same RQG branch, it reproduces the same (or identically looking) assertion on 10.2-10.5. It seems to fail faster than the first one.

git clone https://github.com/MariaDB/randgen --branch mdev17539 rqg-mdev17539
cd rqg-mdev17539
perl ./runall-trials.pl --trials=10 --output='Protocol::end_statement' --grammar=mdev17539-2.yy --scenario=Restart --ps-protocol --threads=6 --duration=200 --gendata-advanced --vardir=/dev/shm/vardir --basedir=/data/bld/10.2

10.4 f5b76d8c

2019-12-09 19:40:32 0 [Note] /data/bld/10.4-debug-nightly/bin/mysqld (initiated by: root[root] @ localhost [127.0.0.1]): Normal shutdown
mysqld: /data/src/10.4/sql/protocol.cc:617: void Protocol::end_statement(): Assertion `0' failed.
191209 19:40:32 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f12e6226f12 in __GI___assert_fail (assertion=0x5613781a9ed8 "0", file=0x5613781a9bf0 "/data/src/10.4/sql/protocol.cc", line=617, function=0x5613781aa550 <Protocol::end_statement()::__PRETTY_FUNCTION__> "void Protocol::end_statement()") at assert.c:101
#8  0x00005613773b83c3 in Protocol::end_statement (this=0x7f12540010b8) at /data/src/10.4/sql/protocol.cc:617
#9  0x00005613774de68d in dispatch_command (command=COM_STMT_PREPARE, thd=0x7f1254000af0, packet=0x7f1254008261 "SELECT * FROM `t5` INTO OUTFILE 'load_t5'  /* QNO 239 CON_ID 17 */ ", packet_length=67, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:2434
#10 0x00005613774dabc9 in do_command (thd=0x7f1254000af0) at /data/src/10.4/sql/sql_parse.cc:1360
#11 0x00005613776636b7 in do_handle_one_connection (connect=0x56137c30d5a0) at /data/src/10.4/sql/sql_connect.cc:1412
#12 0x0000561377663406 in handle_one_connection (arg=0x56137c30d5a0) at /data/src/10.4/sql/sql_connect.cc:1316
#13 0x00007f12e7d9c4a4 in start_thread (arg=0x7f12d04e8700) at pthread_create.c:456
#14 0x00007f12e62e3d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
 
Query (0x0): 
Connection ID (thread ID): 17
Status: KILL_SERVER

Generated at Thu Feb 08 08:37:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.