Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
Description
The attached testcase (fk.sql), can sporadically generate all sorts of issues in the server like crashes (sig 11 in opt), hangs (mysqld + client), inability to automatically create a core file even though error log shows 'mysqld got signal 11', inability to report stack in error log.
The testcase is simple (2 lines only) but the second query is very with FK references. Condensed version (as example of what happens only; not for actual use/replay);
USE test;
|
CREATE TABLE t1 ( `a` int(11) DEFAULT NULL, KEY `a` (`a`),
|
CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1`
|
FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
|
CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa10`
|
FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
|
CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa100`
|
...etc...
|
CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa97`
|
FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
|
CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa98`
|
FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
|
CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa99`
|
FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL );
|
I believe the bug affects 10.1-10.4 opt + dbg from what I have seen thus far, and may affect 10.5 also, though this is not confirmed. The testcase may have to be repeated many times, and it could be that machine load affects the reproducibility (with high load being better).
An example sig11 crash on 10.3.25 optimized:
10.3.25 bafc5c1321a7dff5f2da292111bf98fed9d1658d (Optimized) |
2020-08-12 12:59:12 0 [Note] /test/MD110820-mariadb-10.3.25-linux-x86_64-opt/bin/mysqld: ready for connections.
|
Version: '10.3.25-MariaDB' socket: '/test/MD110820-mariadb-10.3.25-linux-x86_64-opt/socket.sock' port: 11826 MariaDB Server
|
200812 12:59:15 [ERROR] 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.
|
|
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
|
|
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.
|
|
Server version: 10.3.25-MariaDB
|
key_buffer_size=134217728
|
read_buffer_size=131072
|
max_used_connections=1
|
max_threads=153
|
thread_count=7
|
It is possible that mysqld could use up to
|
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467424 K bytes of memory
|
Hope that's ok; if not, decrease some variables in the equation.
|
|
Thread pointer: 0x14d6e3812008
|
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 = 0x14d70af69d98 thread_stack 0x49000
|
Attachments
Issue Links
- relates to
-
MDEV-16417 Store Foreign Key metadata outside of InnoDB
-
- In Review
-
Adding ASAN trace for fk.sql as requested in
MDEV-2346710.4.14 ed1434df88270ebe70ae412b5b723920b6b4e0e8 (Optimized)
ASAN:DEADLYSIGNAL
=================================================================
==2380091==ERROR: AddressSanitizer: SEGV on unknown address 0x6210000a0000 (pc 0x1501e5c91d8f bp 0x000000000d68 sp 0x1501c192c1d8 T31)
==2380091==The signal is caused by a WRITE memory access.
#0 0x1501e5c91d8e (/lib/x86_64-linux-gnu/libc.so.6+0x18ed8e)
#1 0x1501e5b9153b in _IO_default_xsputn (/lib/x86_64-linux-gnu/libc.so.6+0x8e53b)
#2 0x1501e5b6007a in vfprintf (/lib/x86_64-linux-gnu/libc.so.6+0x5d07a)
#3 0x1501e5b84740 in _IO_vsprintf (/lib/x86_64-linux-gnu/libc.so.6+0x81740)
#4 0x55b2cbbcbd18 in __interceptor_vsprintf (/test/ASAN_MD290520-mariadb-10.4.14-linux-x86_64-opt/bin/mysqld+0x4ec6d18)
#5 0x55b2cdea90ed in ib_push_warning(trx_t*, dberr_t, char const*, ...) /test/10.4_opt/storage/innobase/handler/ha_innodb.cc:21571
#6 0x55b2ce816ebc in dict_create_foreign_constraints_low /test/10.4_opt/storage/innobase/dict/dict0dict.cc:4194
#7 0x55b2ce81a568 in dict_create_foreign_constraints(trx_t*, char const*, unsigned long, char const*, unsigned long) /test/10.4_opt/storage/innobase/dict/dict0dict.cc:4582
#8 0x55b2cdeeb34e in create_table_info_t::create_table(bool) /test/10.4_opt/storage/innobase/handler/ha_innodb.cc:12436
#9 0x55b2cdf1605f in ha_innobase::create(char const*, TABLE*, HA_CREATE_INFO*, bool, trx_t*) /test/10.4_opt/storage/innobase/handler/ha_innodb.cc:12884
#10 0x55b2cd117a86 in handler::ha_create(char const*, TABLE*, HA_CREATE_INFO*) /test/10.4_opt/sql/handler.cc:4742
#11 0x55b2cd11b503 in ha_create_table(THD*, char const*, char const*, char const*, HA_CREATE_INFO*, st_mysql_const_unsigned_lex_string*) /test/10.4_opt/sql/handler.cc:5206
#12 0x55b2cc5b60e0 in create_table_impl /test/10.4_opt/sql/sql_table.cc:5070
#13 0x55b2cc5b85df in mysql_create_table_no_lock(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, Table_specification_st*, Alter_info*, bool*, int, TABLE_LIST*) /test/10.4_opt/sql/sql_table.cc:5154
#14 0x55b2cc5b939c in mysql_create_table(THD*, TABLE_LIST*, Table_specification_st*, Alter_info*) /test/10.4_opt/sql/sql_table.cc:5246
#15 0x55b2cc5cfdb1 in Sql_cmd_create_table_like::execute(THD*) /test/10.4_opt/sql/sql_table.cc:11466
#16 0x55b2cc1b54a3 in mysql_execute_command(THD*) /test/10.4_opt/sql/sql_parse.cc:6101
#17 0x55b2cc1e239b in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /test/10.4_opt/sql/sql_parse.cc:7901
#18 0x55b2cc1efefd in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /test/10.4_opt/sql/sql_parse.cc:1841
#19 0x55b2cc1f9937 in do_command(THD*) /test/10.4_opt/sql/sql_parse.cc:1359
#20 0x55b2cc8044ae in do_handle_one_connection(CONNECT*) /test/10.4_opt/sql/sql_connect.cc:1412
#21 0x55b2cc804d92 in handle_one_connection /test/10.4_opt/sql/sql_connect.cc:1316
#22 0x1501e800b6da in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
#23 0x1501e5c24a3e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x121a3e)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x18ed8e)
Thread T31 created by T0 here:
#0 0x55b2cbb6520f in __interceptor_pthread_create (/test/ASAN_MD290520-mariadb-10.4.14-linux-x86_64-opt/bin/mysqld+0x4e6020f)
#1 0x55b2cbc6043b in inline_mysql_thread_create /test/10.4_opt/include/mysql/psi/mysql_thread.h:1275
#2 0x55b2cbc6043b in create_thread_to_handle_connection(CONNECT*) /test/10.4_opt/sql/mysqld.cc:6261
#3 0x55b2cbc72e29 in create_new_thread(CONNECT*) /test/10.4_opt/sql/mysqld.cc:6329
#4 0x55b2cbc73688 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /test/10.4_opt/sql/mysqld.cc:6427
#5 0x55b2cbc74d0b in handle_connections_sockets() /test/10.4_opt/sql/mysqld.cc:6585
#6 0x55b2cbc772a4 in mysqld_main(int, char**) /test/10.4_opt/sql/mysqld.cc:5917
#7 0x1501e5b24b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
==2380091==ABORTING