[MDEV-10624] Crash on CREATE VIEW (with invalid definer, or invalid references) Created: 2016-08-21  Updated: 2021-01-21  Resolved: 2021-01-21

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

Type: Bug Priority: Major
Reporter: Ján Regeš Assignee: Unassigned
Resolution: Incomplete Votes: 1
Labels: None
Environment:

Gentoo Linux, kernel 3.12.6 - compiled without Galera


Issue Links:
Relates
relates to MDEV-10062 Random crash about once a week (mysql... Closed

 Description   

Hi,

i updated MariaDB from 10.0.? to 10.1.16 and backup process (mysqldump) crashes whole MariaDB.

There are 2 critical issues after upgrade:

1) In the database exists view with not-existent definer, like "@%", or "non-existent-user@%"
2) In the database exists view already with invalid references/tables

Example from log:

Server version: 10.1.16-MariaDB
key_buffer_size=536870912
read_buffer_size=1048576
max_used_connections=13
max_threads=502
thread_count=13
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 5160790 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x0x7fdfb2ddf008
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 = 0x7fdf719fde98 thread_stack 0x200000
/usr/sbin/mysqld(my_print_stacktrace+0x29)[0x7fe1599e8f7f]
/usr/sbin/mysqld(handle_fatal_signal+0x2dd)[0x7fe15954132d]
/lib64/libpthread.so.0(+0x103b0)[0x7fe1577023b0]
/usr/sbin/mysqld(+0x46cb7d)[0x7fe159438b7d]
/usr/sbin/mysqld(_ZN13st_select_lex5printEP3THDP6String15enum_query_type+0x47a)[0x7fe1594392da]
/usr/sbin/mysqld(_ZN14Item_subselect5printEP6String15enum_query_type+0x5b)[0x7fe1595bc5db]
/usr/sbin/mysqld(_ZN9Item_func8print_opEP6String15enum_query_type+0x16e)[0x7fe159596f3e]
/usr/sbin/mysqld(+0x46ccf0)[0x7fe159438cf0]
/usr/sbin/mysqld(_ZN10TABLE_LIST5printEP3THDyP6String15enum_query_type+0x50)[0x7fe1594389f0]
/usr/sbin/mysqld(+0x46cc56)[0x7fe159438c56]
/usr/sbin/mysqld(_ZN13st_select_lex5printEP3THDP6String15enum_query_type+0x47a)[0x7fe1594392da]
/usr/sbin/mysqld(_ZN18st_select_lex_unit5printEP6String15enum_query_type+0x4f)[0x7fe1593e419f]
/usr/sbin/mysqld(_Z29mysqld_show_create_get_fieldsP3THDP10TABLE_LISTP4ListI4ItemEP6String+0x2a8)[0x7fe159447d38]
/usr/sbin/mysqld(_Z18mysqld_show_createP3THDP10TABLE_LIST+0xaf)[0x7fe15944878f]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x3751)[0x7fe1593f1ea1]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x214)[0x7fe1593f5e94]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x151e)[0x7fe1593f7a6e]
/usr/sbin/mysqld(_Z10do_commandP3THD+0xd7)[0x7fe1593f8527]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0x1c4)[0x7fe1594affe4]
/usr/sbin/mysqld(handle_one_connection+0x37)[0x7fe1594b0077]
/lib64/libpthread.so.0(+0x730c)[0x7fe1576f930c]
/lib64/libc.so.6(clone+0x6d)[0x7fe15637d85d]
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7fdfa06a5020): is an invalid pointer
Connection ID (thread ID): 371
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: SHOW CREATE VIEW `ucet_angazma`



 Comments   
Comment by Elena Stepanova [ 2016-08-22 ]

Could you please attach or upload frm files of the problematic views? If you choose to upload, you can use ftp.askmonty.org/private.

Comment by Elena Stepanova [ 2016-09-25 ]

Please comment if you have further information on the issue, and the report will be re-opened.

Comment by sangmo kim [ 2016-11-08 ]

create procedure 할때 definer 없이 하면 아래와 같은 에러가 발생합니다.

The user specified as a definer ('user'@'%') does not exist

해당 에러가 난 이후에 10.0.x에서 call procedure() 하면 에러없이 실행을 합니다.

10.1.x, 10.2.x 버전에서는 mariadb crash 발생합니다.
[ERROR] mysqld got exception 0xc0000005 ;

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