Server crashed at function fetch_step(que_thr_t*)

Description

PoC:

 

CREATE TABLE t1 (a SERIAL, t TEXT, FULLTEXT f1(t), FULLTEXT f2(t)) ENGINE=InnoDB; INSERT INTO t1 (a,t) VALUES (1,'1'),(2,'1'); ALTER TABLE t1 ADD COLUMN g TEXT GENERATED ALWAYS AS (t) VIRTUAL; DELETE FROM t1 WHERE a = 1; ALTER TABLE t1 DROP INDEX f1; INSERT INTO t1 (a,t) VALUES (1,'1');

Server report:

Build ID: 18aaa142649c55cdd3da3a4b5bea39fe4cc9a679 Server Version: 8.0.28-19 Percona Server (GPL), Release 19, Revision 31e88966cd3Thread pointer: 0x7f919c000fc0 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 = 7f920c6f6d50 thread_stack 0x100000 /usr/sbin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x41) [0x20cbe11] /usr/sbin/mysqld(print_fatal_signal(int)+0x323) [0x11506e3] /usr/sbin/mysqld(handle_fatal_signal+0xbd) [0x11507ad] /lib64/libpthread.so.0(+0x12cf0) [0x7f9226022cf0] /usr/sbin/mysqld() [0x256590c] /usr/sbin/mysqld() [0x2568c31] /usr/sbin/mysqld(fetch_step(que_thr_t*)+0xde) [0x233020e] /usr/sbin/mysqld(que_run_threads(que_thr_t*)+0x498) [0x22dc888] /usr/sbin/mysqld(fts_eval_sql(trx_t*, que_fork_t*)+0x31) [0x2586e71] /usr/sbin/mysqld(fts_doc_fetch_by_doc_id(fts_get_doc_t*, unsigned long, dict_index_t*, unsigned long, unsigned long (*)(void*, void*), void*)+0xec) [0x2564d4c] /usr/sbin/mysqld(fts_init_index(dict_table_t*, unsigned long)+0x1b1) [0x256eac1] /usr/sbin/mysqld(fts_init_doc_id(dict_table_t const*)+0xed) [0x256ee3d] /usr/sbin/mysqld(fts_get_next_doc_id(dict_table_t const*, unsigned long*)+0xe5) [0x25709f5] /usr/sbin/mysqld(fts_create_doc_id(dict_table_t*, dtuple_t*, mem_block_info_t*)+0x8f) [0x2570a9f] /usr/sbin/mysqld() [0x2302e84] /usr/sbin/mysqld(ha_innobase::write_row(unsigned char*)+0x339) [0x21dad79] /usr/sbin/mysqld(handler::ha_write_row(unsigned char*)+0x1a4) [0xcd1b34] /usr/sbin/mysqld(write_record(THD*, TABLE*, COPY_INFO*, COPY_INFO*)+0x62f) [0xfabc8f] /usr/sbin/mysqld(Sql_cmd_insert_values::execute_inner(THD*)+0xa35) [0xfad7a5] /usr/sbin/mysqld(Sql_cmd_dml::execute(THD*)+0x186) [0x104b7c6] /usr/sbin/mysqld(mysql_execute_command(THD*, bool)+0xa10) [0xfe2d20] /usr/sbin/mysqld(Prepared_statement::execute(String*, bool)+0x898) [0x10157c8] /usr/sbin/mysqld(Prepared_statement::execute_loop(String*, bool)+0x12e) [0x101a47e] /usr/sbin/mysqld(mysqld_stmt_execute(THD*, Prepared_statement*, bool, unsigned long, PS_PARAM*)+0x1b1) [0x101aad1] /usr/sbin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x2692) [0xfe96d2] /usr/sbin/mysqld(do_command(THD*)+0x18d) [0xfea05d] /usr/sbin/mysqld() [0x1140420] /usr/sbin/mysqld() [0x25f7ef4] /lib64/libpthread.so.0(+0x81df) [0x7f92260181df] /lib64/libc.so.6(clone+0x43) [0x7f92243bcd83]Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (7f919c00aeb0): INSERT INTO t1 (a,t) VALUES (1,'1') Connection ID (thread ID): 8 Status: NOT_KILLEDPlease help us make Percona Server better by reporting any bugs at https://bugs.percona.com/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.

 

Environment

OS: ubuntu 20.04 with docker 20.10.14

Percona Server version: official docker image 8.0.28-19 (percona:8.0.28-19)

 

Smart Checklist

Activity

Show:

Aaditya Dubey June 24, 2022 at 8:58 AM

Hi  ,

As we discussed,
Please note that same crash is happening in 8.0.28(Upstream) as well.

08:53:50 UTC - mysqld got signal 11 ; Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware. Thread pointer: 0x7f5680010990 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 = 7f56d43f1d80 thread_stack 0x100000 /home/user/ora8.0.28/bin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x2e) [0x1f9ffde] /home/user/ora8.0.28/bin/mysqld(print_fatal_signal(int)+0x2eb) [0x103628b] /home/user/ora8.0.28/bin/mysqld(handle_fatal_signal+0x65) [0x10362f5] /lib64/libpthread.so.0(+0xf630) [0x7f56e915a630] /home/user/ora8.0.28/bin/mysqld() [0x23dccd5] /home/user/ora8.0.28/bin/mysqld() [0x23debf6] /home/user/ora8.0.28/bin/mysqld(fetch_step(que_thr_t*)+0xce) [0x21cad0e] /home/user/ora8.0.28/bin/mysqld(que_run_threads(que_thr_t*)+0x560) [0x217b070] /home/user/ora8.0.28/bin/mysqld(fts_eval_sql(trx_t*, que_fork_t*)+0x2d) [0x23fc86d] /home/user/ora8.0.28/bin/mysqld(fts_doc_fetch_by_doc_id(fts_get_doc_t*, unsigned long, dict_index_t*, unsigned long, unsigned long (*)(void*, void*), void*)+0xd7) [0x23dc2b7] /home/user/ora8.0.28/bin/mysqld(fts_init_index(dict_table_t*, unsigned long)+0x1cd) [0x23e49ed] /home/user/ora8.0.28/bin/mysqld(fts_init_doc_id(dict_table_t const*)+0x8d) [0x23e4b8d] /home/user/ora8.0.28/bin/mysqld(fts_get_next_doc_id(dict_table_t const*, unsigned long*)+0xb5) [0x23e6465] /home/user/ora8.0.28/bin/mysqld(fts_create_doc_id(dict_table_t*, dtuple_t*, mem_block_info_t*)+0x67) [0x23e64d7] /home/user/ora8.0.28/bin/mysqld() [0x21a03e8] /home/user/ora8.0.28/bin/mysqld(ha_innobase::write_row(unsigned char*)+0x24f) [0x208547f] /home/user/ora8.0.28/bin/mysqld(handler::ha_write_row(unsigned char*)+0x188) [0x113f948] /home/user/ora8.0.28/bin/mysqld(write_record(THD*, TABLE*, COPY_INFO*, COPY_INFO*)+0x615) [0x13a09b5] /home/user/ora8.0.28/bin/mysqld(Sql_cmd_insert_values::execute_inner(THD*)+0x7d9) [0x13a1bb9] /home/user/ora8.0.28/bin/mysqld(Sql_cmd_dml::execute(THD*)+0x2c5) [0xf47805] /home/user/ora8.0.28/bin/mysqld(mysql_execute_command(THD*, bool)+0xad8) [0xee6838] /home/user/ora8.0.28/bin/mysqld(dispatch_sql_command(THD*, Parser_state*)+0x403) [0xeeb473] /home/user/ora8.0.28/bin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x2091) [0xeed9e1] /home/user/ora8.0.28/bin/mysqld(do_command(THD*)+0x103) [0xeee853] /home/user/ora8.0.28/bin/mysqld() [0x10271b8] /home/user/ora8.0.28/bin/mysqld() [0x24d8fec] /lib64/libpthread.so.0(+0x7ea5) [0x7f56e9152ea5] /lib64/libc.so.6(clone+0x6d) [0x7f56e74c29fd]Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (7f5680248540): INSERT INTO t1 (a,t) VALUES (1,'1') Connection ID (thread ID): 9 Status: NOT_KILLED

 

Aaditya Dubey June 23, 2022 at 1:45 PM

Hi  ,

Thank you for the report.
I have tried reproducing the issue and it is repeating, please find my test case below:

Server version: 8.0.28-19 Percona Server (GPL), Release 19, Revision 31e88966cd3 mysql [localhost:3370] {msandbox} (test) > CREATE TABLE t1 (a SERIAL, t TEXT, FULLTEXT f1(t), FULLTEXT f2(t)) ENGINE=InnoDB; Query OK, 0 rows affected, 1 warning (0.09 sec) mysql [localhost:3370] {msandbox} (test) > INSERT INTO t1 (a,t) VALUES (1,'1'),(2,'1'); Query OK, 2 rows affected (0.02 sec) Records: 2  Duplicates: 0  Warnings: 0 mysql [localhost:3370] {msandbox} (test) > ALTER TABLE t1 ADD COLUMN g TEXT GENERATED ALWAYS AS (t) VIRTUAL; Query OK, 0 rows affected (0.02 sec) Records: 0  Duplicates: 0  Warnings: 0 mysql [localhost:3370] {msandbox} (test) > DELETE FROM t1 WHERE a = 1; Query OK, 1 row affected (0.00 sec) mysql [localhost:3370] {msandbox} (test) > ALTER TABLE t1 DROP INDEX f1; Query OK, 0 rows affected (0.03 sec) Records: 0  Duplicates: 0  Warnings: 0 mysql [localhost:3370] {msandbox} (test) >  INSERT INTO t1 (a,t) VALUES (1,'1');  ERROR 2013 (HY000): Lost connection to MySQL server during query No connection. Trying to reconnect... ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql_sandbox3370.sock' (111) ERROR:  Can't connect to the server Stack Trace: 13:12:04 UTC - mysqld got signal 11 ; Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.Build ID: Not Available Server Version: 8.0.28-19 Percona Server (GPL), Release 19, Revision 31e88966cd3Thread pointer: 0x7f42f741e000 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 = 7f431292dc30 thread_stack 0x100000 /home/user/ps8.0.28/bin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x3d) [0x204145d] /home/user/ps8.0.28/bin/mysqld(print_fatal_signal(int)+0x323) [0x1131b13] /home/user/ps8.0.28/bin/mysqld(handle_fatal_signal+0xb5) [0x1131bd5] /lib64/libpthread.so.0(+0xf630) [0x7f4331962630] /home/user/ps8.0.28/bin/mysqld() [0x245f78c] /home/user/ps8.0.28/bin/mysqld() [0x2463eb1] /home/user/ps8.0.28/bin/mysqld(fetch_step(que_thr_t*)+0xde) [0x227296e] /home/user/ps8.0.28/bin/mysqld(que_run_threads(que_thr_t*)+0x498) [0x222aa08] /home/user/ps8.0.28/bin/mysqld(fts_eval_sql(trx_t*, que_fork_t*)+0x2d) [0x247976d] /home/user/ps8.0.28/bin/mysqld(fts_doc_fetch_by_doc_id(fts_get_doc_t*, unsigned long, dict_index_t*, unsigned long, unsigned long (*)(void*, void*), void*)+0xe8) [0x245ebd8] /home/user/ps8.0.28/bin/mysqld(fts_init_index(dict_table_t*, unsigned long)+0x1c1) [0x2467191] /home/user/ps8.0.28/bin/mysqld(fts_init_doc_id(dict_table_t const*)+0x105) [0x2467585] /home/user/ps8.0.28/bin/mysqld(fts_get_next_doc_id(dict_table_t const*, unsigned long*)+0xe5) [0x2468f85] /home/user/ps8.0.28/bin/mysqld(fts_create_doc_id(dict_table_t*, dtuple_t*, mem_block_info_t*)+0x87) [0x2469027] /home/user/ps8.0.28/bin/mysqld() [0x224a984] /home/user/ps8.0.28/bin/mysqld(ha_innobase::write_row(unsigned char*)+0x339) [0x21480d9] /home/user/ps8.0.28/bin/mysqld(handler::ha_write_row(unsigned char*)+0x1b8) [0xcc5088] /home/user/ps8.0.28/bin/mysqld(write_record(THD*, TABLE*, COPY_INFO*, COPY_INFO*)+0x5df) [0xf92d0f] /home/user/ps8.0.28/bin/mysqld(Sql_cmd_insert_values::execute_inner(THD*)+0xa35) [0xf94815] /home/user/ps8.0.28/bin/mysqld(Sql_cmd_dml::execute(THD*)+0x186) [0x1027af6] /home/user/ps8.0.28/bin/mysqld(mysql_execute_command(THD*, bool)+0x9f0) [0xfc9e20] /home/user/ps8.0.28/bin/mysqld(dispatch_sql_command(THD*, Parser_state*, bool)+0x4f8) [0xfcdc48] /home/user/ps8.0.28/bin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x14be) [0xfcf63e] /home/user/ps8.0.28/bin/mysqld(do_command(THD*)+0x189) [0xfd1149] /home/user/ps8.0.28/bin/mysqld() [0x1122460] /home/user/ps8.0.28/bin/mysqld() [0x24e6820] /lib64/libpthread.so.0(+0x7ea5) [0x7f433195aea5] /lib64/libc.so.6(clone+0x6d) [0x7f432fcc29fd]Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (7f42f6054030): INSERT INTO t1 (a,t) VALUES (1,'1') Connection ID (thread ID): 9 Status: NOT_KILLED

Please note it is crashing in 8.0.29(Upstream) as well.

As a workaround please remove duplicate FULLTEXT index from table Definition to avoid the crash.
sending the concern to engineering for further review and updates.

Details

Assignee

Reporter

Priority

Smart Checklist

Created June 19, 2022 at 5:07 PM
Updated March 6, 2024 at 10:05 AM