[MDEV-23006] MariaDB service crashes when running the DESCRIBE command Created: 2020-06-24  Updated: 2020-06-24  Resolved: 2020-06-24

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.4.12
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Andy Ling Assignee: Vladislav Vaintroub
Resolution: Duplicate Votes: 0
Labels: None
Environment:

Windows server 2018 64bit running a java app using mariadb connector/J 2.5.4


Issue Links:
Duplicate
duplicates MDEV-21616 Server crash when using "SET STATEMEN... Closed

 Description   

I am running MariaDB 10.4.12 on Windows Server 2018. I am connecting to it from a Java application using mariadb-java-client-2.5.4

I use Statement.executeQuery(string) to execute a query on the database. Most of the time this works without a problem, but I have just found that if the query is “DESCRIBE servers”, where servers is the name of a table, it crashes the MariaDB service.

I can run the query without a problem from the mysql shell, it is only when running it through the java connector.

The error log crash data is shown below.

Version: '10.4.12-MariaDB-log' socket: '' port: 3306 mariadb.org binary distribution
200624 15:48:11 [ERROR] mysqld got exception 0xc0000005 ;
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.4.12-MariaDB-log
key_buffer_size=65536
read_buffer_size=131072
max_used_connections=16
max_threads=65537
thread_count=22
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 5380 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x209c95a8
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...
mysqld.exe!st_select_lex::init_select()[sql_lex.cc:2428]
mysqld.exe!mysql_init_select()[sql_parse.cc:7492]
mysqld.exe!MYSQLparse()[sql_yacc.yy:14556]
mysqld.exe!parse_sql()[sql_parse.cc:10210]
mysqld.exe!mysql_parse()[sql_parse.cc:7856]
mysqld.exe!dispatch_command()[sql_parse.cc:1844]
mysqld.exe!do_command()[sql_parse.cc:1359]
mysqld.exe!threadpool_process_request()[threadpool_common.cc:366]
mysqld.exe!tp_callback()[threadpool_common.cc:193]
ntdll.dll!RtlDllShutdownInProgress()
ntdll.dll!DbgUiRemoteBreakin()
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x209c15c0): SET STATEMENT max_statement_time=5 FOR describe servers
Connection ID (thread ID): 52
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=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on

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.
Writing a core file at C:\Data\MySQL\data\



 Comments   
Comment by Vladislav Vaintroub [ 2020-06-24 ]

Helpful error log shows that JDBC transformed your query into "SET STATEMENT max_statement_time=5 FOR describe servers". you probably have some JDBC timeout set. Alas, the query is valid still.

Comment by Andy Ling [ 2020-06-24 ]

There is a call to setQueryTimeout just before the executeQuery call, but this happens for the queries that work too.

Comment by Andy Ling [ 2020-06-24 ]

If I comment out the call to setQueryTimeout then it doesn't crash.

The Java code looks like this...

conn = DBCluster.getReadConnection () ;
stmt = conn.createStatement () ;
stmt.setQueryTimeout (5) ;
rs = stmt.executeQuery (query) ;

It crashes on the execute, not the set timeout. I guess the DESCRIBE call doesn't like the timeout being set. But as you say, it shouldn't crash.

Comment by Vladislav Vaintroub [ 2020-06-24 ]

this is fixed in 10.4.13, MDEV-21616

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