[MDEV-11667] Crash on select from information_schema.tables Created: 2016-12-26  Updated: 2021-02-16

Status: Open
Project: MariaDB Server
Component/s: Information Schema, Storage Engine - Federated
Affects Version/s: 10.1.20
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Rob Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None
Environment:

Centos 6



 Description   

This error I get on multiple servers on select * from information_schema.tables;

161226 13:08:52 [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.1.20-MariaDB
key_buffer_size=268435456
read_buffer_size=1048576
max_used_connections=2
max_threads=2002
thread_count=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 4403338 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x0x7f8ecffe8008
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 = 0x7fd7e89f6140 thread_stack 0x48400
/usr/sbin/mysqld(my_print_stacktrace+0x2b)[0x7fe1c92c05cb]
/usr/sbin/mysqld(handle_fatal_signal+0x4d5)[0x7fe1c8e19375]
/lib64/libpthread.so.0(+0xf7e0)[0x7fe1c841b7e0]
/usr/sbin/mysqld(_Z21open_table_from_shareP3THDP11TABLE_SHAREPKcjjjP5TABLEb+0xe3d)[0x7fe1c8d48bed]
/usr/sbin/mysqld(_Z10open_tableP3THDP10TABLE_LISTP18Open_table_context+0x2a5)[0x7fe1c8c615f5]
/usr/sbin/mysqld(_Z11open_tablesP3THDRK14DDL_options_stPP10TABLE_LISTPjjP19Prelocking_strategy+0xf12)[0x7fe1c8c65b02]
/usr/sbin/mysqld(_Z30open_normal_and_derived_tablesP3THDP10TABLE_LISTjj+0x59)[0x7fe1c8c65de9]
/usr/sbin/mysqld(+0x4b510e)[0x7fe1c8d0010e]
/usr/sbin/mysqld(_Z14get_all_tablesP3THDP10TABLE_LISTP4Item+0x81e)[0x7fe1c8d1557e]
/usr/sbin/mysqld(_Z24get_schema_tables_resultP4JOIN23enum_schema_table_state+0x28e)[0x7fe1c8d130ce]
/usr/sbin/mysqld(_ZN4JOIN10exec_innerEv+0x6b5)[0x7fe1c8cfad85]
/usr/sbin/mysqld(_ZN4JOIN4execEv+0x5d)[0x7fe1c8cfd19d]
/usr/sbin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x12a)[0x7fe1c8cf9b6a]
mysys/stacktrace.c:268(my_print_stacktrace)[0x7fe1c8cfd47d]
sql/signal_handler.cc:168(handle_fatal_signal)[0x7fe1c8c9ce32]
sql/table.cc:2950(open_table_from_share(THD*, TABLE_SHARE*, char const*, unsigned int, unsigned int, unsigned int, TABLE*, bool))[0x7fe1c8ca90fc]
sql/sql_base.cc:2554(open_table(THD*, TABLE_LIST*, Open_table_context*))[0x7fe1c8cac6b4]
sql/sql_show.cc:4183(fill_schema_table_by_open)[0x7fe1c8caf183]
/usr/sbin/mysqld(_Z10do_commandP3THD+0x16b)[0x7fe1c8caf71b]
sql/sql_select.cc:2656(JOIN::exec_inner())[0x7fe1c8d6dfff]
sql/sql_select.cc:3441(mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x7fe1c8d6e157]
sql/sql_parse.cc:5897(execute_sqlcom_select)[0x7fe1c8413aa1]
/lib64/libc.so.6(clone+0x6d)[0x7fe1c68f7aad]
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7f8ed6028020): is an invalid pointer
Connection ID (thread ID): 22
Status: NOT_KILLED
 
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
 
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
 
We think the query pointer is invalid, but we will try to print it anyway. 
Query: select * from information_schema.tables



 Comments   
Comment by Elena Stepanova [ 2016-12-26 ]

Are you getting it all the time when you run select * from information_schema.tables, or does it happen sporadically, or does it seem to depend on some conditions?
Also, these multiple servers where you run the query – are they independent, or connected by some replication/cluster setup?

Comment by Rob [ 2016-12-27 ]

It happens each time I run the query.
I have two DL380 G8 slaves and one on DL380 G6
These are all slaves. I also have slaves on same hardware that do not have the problem.
I do not have the problem on masters or masters that are also slaves.
It is version 10.1.20
I have had this problem for a few months.

Hope that helps. Thanks in advance.

Comment by Rob [ 2016-12-27 ]

I have found the problem

The issues is that the servers have some federatedx tables.
The server where these tables are on did not allow access to the relevant tables
Creating the access resolved the problem.

Guess you should adjust the code in information_schema.tables to give a proper error message in this case instead of crashing the server.

Hope that helps,

Rob

Comment by Elena Stepanova [ 2016-12-27 ]

Thanks for the information.
For us to reproduce it more easily, could you please also specify what kind of access was missing, exactly? Was it that the user in federated connection didn't have access to the tables, or it didn't have access to the database, or there was no connection between servers at all (e.g. firewall or something), or...?

Comment by Rob [ 2016-12-27 ]

I created a slave A from another slave B .
The new slave should connect to another server C using federated connection for certain tables.
A did not have a user on C
So selecting from the federatedx woudl give a access exception
and the select from tables crash the server

So I created a user on C for server A and granted access to the relevant tables referenced by the federated tables.
Now no acces exception for the federated table
and the select from tables works as it should.

Comment by Jed Walker [ 2017-09-11 ]

I have this same issue. Our DB was MariaDB 10.1.21 and if we ran:
select table_schema, table_name, table_type, engine, row_format, table_rows, avg_row_length, data_length, max_data_length, index_length, data_free, create_time, update_time, create_options, table_collation from information_schema.tables;
The session would fail and the db would crash. I'll put mysqld.log info below on the crash.
We have since upgrade to 10.1.26 and now the DB does not crash anymore, but the sql still fails with:
Error Code: 2003. Received error: 2003 : Can't connect to MySQL server on 'rckdmdb002' (111 "Connection refused")

I find the Federated tables interesting, because the server this is crashing on has Federated X installed and we use it push certain changes out to its child federated databases. In addition, it is a mysql master to 2 slaves for one of its databases.

here is what the crash showed:
170905 13:31:16 [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.1.21-MariaDB
key_buffer_size=524288000
read_buffer_size=524288000
max_used_connections=141
max_threads=1002
thread_count=128
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1026580559 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x7f3209770008
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 = 0x7f320a476208 thread_stack 0x48400
/mysql/current/bin/mysqld(my_print_stacktrace+0x2e)[0xc0a26e]
/mysql/current/bin/mysqld(handle_fatal_signal+0x4bf)[0x76880f]
/lib64/libpthread.so.0(+0xf710)[0x7f33547f8710]
/mysql/current/bin/mysqld(_Z21open_table_from_shareP3THDP11TABLE_SHAREPKcjjjP5TABLEb+0xc81)[0x667561]
/mysql/current/bin/mysqld(_Z10open_tableP3THDP10TABLE_LISTP18Open_table_context+0x8c4)[0x56c9f4]
/mysql/current/bin/mysqld(_Z11open_tablesP3THDRK14DDL_options_stPP10TABLE_LISTPjjP19Prelocking_strategy+0xe37)[0x56f347]
/mysql/current/bin/mysqld(_Z30open_normal_and_derived_tablesP3THDP10TABLE_LISTjj+0x63)[0x56fb73]
/mysql/current/bin/mysqld[0x61465f]
/mysql/current/bin/mysqld(_Z14get_all_tablesP3THDP10TABLE_LISTP4Item+0x7f3)[0x61f793]
/mysql/current/bin/mysqld(_Z24get_schema_tables_resultP4JOIN23enum_schema_table_state+0x2ee)[0x613f5e]
/mysql/current/bin/mysqld(_ZN4JOIN10exec_innerEv+0x908)[0x6099d8]
/mysql/current/bin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x1dc)[0x6085ec]
/mysql/current/bin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x250)[0x60c1e0]
/mysql/current/bin/mysqld[0x5aeee8]
/mysql/current/bin/mysqld(_Z21mysql_execute_commandP3THD+0x14b3)[0x5b3a63]
/mysql/current/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x34e)[0x5bbcee]
/mysql/current/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x237b)[0x5beceb]
/mysql/current/bin/mysqld(_Z10do_commandP3THD+0x157)[0x5befa7]
/mysql/current/bin/mysqld(_Z24do_handle_one_connectionP3THD+0x183)[0x68eb73]
/mysql/current/bin/mysqld(handle_one_connection+0x42)[0x68ed82]
/lib64/libpthread.so.0(+0x79d1)[0x7f33547f09d1]
/lib64/libc.so.6(clone+0x6d)[0x7f335376f9dd]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7f321683b020): select CONSTRAINT_SCHEMA index_schema, CONSTRAINT_NAME index_name, TABLE_SCHEMA, table_name, column_name, ordinal_position, REFERENCED_TABLE_SCHEMA, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME from information_schema.KEY_COLUMN_USAGE
Connection ID (thread ID): 13585
Status: NOT_KILLED
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
170905 13:31:16 mysqld_safe Number of processes running now: 0
170905 13:31:16 mysqld_safe mysqld restarted

Generated at Thu Feb 08 07:51:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.