[MDEV-9697] Crash with wsrep-forced-binlog-format=ROW + GRANT statement Created: 2016-03-07  Updated: 2016-03-18  Resolved: 2016-03-18

Status: Closed
Project: MariaDB Server
Component/s: Galera
Affects Version/s: 10.1.12
Fix Version/s: 10.1.13, 5.5.49-galera, 10.0.25-galera

Type: Bug Priority: Major
Reporter: Andrew Garner Assignee: Nirbhay Choubey (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

CentOS 7, yum.mariadb.org packages


Issue Links:
Duplicate
duplicates MDEV-9401 wsrep_forced_binlog_format With Binlo... Closed
Sprint: 10.1.13

 Description   

I ran across this when bootstrapping a MariaDB 10.1 based Galera cluster under CentOS7. Granting a new user with binary logs enabled and wsrep_forced_binlog_format = ROW leads to a crash.

Here's the simplest my.cnf I found to reproduce this:

 
# my_print_defaults mysqld server mysqld-10.1 mariadb mariadb-10.1 client-server galera
--wsrep_on=ON
--wsrep_provider=/usr/lib64/galera/libgalera_smm.so
--log_bin
--binlog_format=row
--wsrep_forced_binlog_format=row

And here are the commands that lead to the crash

 
# galera_new_cluster
 
# mysql -e "DROP USER IF EXISTS test_user@localhost; GRANT USAGE ON *.* TO test_user@localhost IDENTIFIED BY 'random_password'"
ERROR 2013 (HY000) at line 1: Lost connection to MySQL server during query

And the stack trace from the logs

Mar 07 19:19:28 galera-test01 mysqld[28431]: 160307 19:19:28 [ERROR] mysqld got signal 11 ;
Mar 07 19:19:28 galera-test01 mysqld[28431]: This could be because you hit a bug. It is also possible that this binary
Mar 07 19:19:28 galera-test01 mysqld[28431]: or one of the libraries it was linked against is corrupt, improperly built,
Mar 07 19:19:28 galera-test01 mysqld[28431]: or misconfigured. This error can also be caused by malfunctioning hardware.
Mar 07 19:19:28 galera-test01 mysqld[28431]: To report this bug, see http://kb.askmonty.org/en/reporting-bugs
Mar 07 19:19:28 galera-test01 mysqld[28431]: We will try our best to scrape up some info that will hopefully help
Mar 07 19:19:28 galera-test01 mysqld[28431]: diagnose the problem, but since we have already crashed,
Mar 07 19:19:28 galera-test01 mysqld[28431]: something is definitely wrong and this may fail.
Mar 07 19:19:28 galera-test01 mysqld[28431]: Server version: 10.1.12-MariaDB
Mar 07 19:19:28 galera-test01 mysqld[28431]: key_buffer_size=134217728
Mar 07 19:19:28 galera-test01 mysqld[28431]: read_buffer_size=131072
Mar 07 19:19:28 galera-test01 mysqld[28431]: max_used_connections=1
Mar 07 19:19:28 galera-test01 mysqld[28431]: max_threads=153
Mar 07 19:19:28 galera-test01 mysqld[28431]: thread_count=1
Mar 07 19:19:28 galera-test01 mysqld[28431]: It is possible that mysqld could use up to
Mar 07 19:19:28 galera-test01 mysqld[28431]: key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467113 K  bytes of memory
Mar 07 19:19:28 galera-test01 mysqld[28431]: Hope that's ok; if not, decrease some variables in the equation.
Mar 07 19:19:28 galera-test01 mysqld[28431]: Thread pointer: 0x0x7f5100bba008
Mar 07 19:19:28 galera-test01 mysqld[28431]: Attempting backtrace. You can use the following information to find out
Mar 07 19:19:28 galera-test01 mysqld[28431]: where mysqld died. If you see no messages after this, something went
Mar 07 19:19:28 galera-test01 mysqld[28431]: terribly wrong...
Mar 07 19:19:28 galera-test01 mysqld[28431]: stack_bottom = 0x7f5105655130 thread_stack 0x48400
Mar 07 19:19:28 galera-test01 mysqld[28431]: /usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x7f51061aa8fe]
Mar 07 19:19:28 galera-test01 mysqld[28431]: /usr/sbin/mysqld(handle_fatal_signal+0x38d)[0x7f5105cd769d]
Mar 07 19:19:28 galera-test01 mysqld[28431]: /lib64/libpthread.so.0(+0xf130)[0x7f51052f7130]
Mar 07 19:19:28 galera-test01 mysqld[28431]: /usr/sbin/mysqld(bitmap_bits_set+0xe)[0x7f51061a016e]
Mar 07 19:19:28 galera-test01 mysqld[28431]: /usr/sbin/mysqld(_Z8pack_rowP5TABLEPK9st_bitmapPhPKh+0x2f)[0x7f5105db78bf]
Mar 07 19:19:28 galera-test01 mysqld[28431]: /usr/sbin/mysqld(_ZN3THD16binlog_write_rowEP5TABLEbPKh+0x76)[0x7f5105b2f376]
Mar 07 19:19:28 galera-test01 mysqld[28431]: mysys/stacktrace.c:247(my_print_stacktrace)[0x7f5105ce16fd]
Mar 07 19:19:28 galera-test01 mysqld[28431]: sql/sql_class.cc:6300(THD::binlog_write_row(TABLE*, bool, unsigned char const*))[0x7f5105af16dd]
Mar 07 19:19:28 galera-test01 mysqld[28431]: sql/handler.cc:5753(binlog_log_row)[0x7f5105b0a1b4]
Mar 07 19:19:28 galera-test01 mysqld[28431]: sql/sql_acl.cc:3600(replace_user_table)[0x7f5105b5cec2]
Mar 07 19:19:28 galera-test01 mysqld[28431]: sql/sql_parse.cc:4754(mysql_execute_command(THD*))[0x7f5105b5f17e]
Mar 07 19:19:28 galera-test01 mysqld[28431]: sql/sql_parse.cc:1488(dispatch_command(enum_server_command, THD*, char*, unsigned int))[0x7f5105b6263b]
Mar 07 19:19:28 galera-test01 mysqld[28431]: sql/sql_parse.cc:1111(do_command(THD*))[0x7f5105b62eb9]
Mar 07 19:19:28 galera-test01 mysqld[28431]: sql/sql_connect.cc:1349(do_handle_one_connection(THD*))[0x7f5105c2657a]
Mar 07 19:19:28 galera-test01 mysqld[28431]: sql/sql_connect.cc:1263(handle_one_connection)[0x7f5105c26750]
Mar 07 19:19:28 galera-test01 mysqld[28431]: /lib64/libpthread.so.0(+0x7df3)[0x7f51052efdf3]
Mar 07 19:19:28 galera-test01 mysqld[28431]: /lib64/libc.so.6(clone+0x6d)[0x7f51037171ad]
Mar 07 19:19:28 galera-test01 mysqld[28431]: Trying to get some variables.
Mar 07 19:19:28 galera-test01 mysqld[28431]: Some pointers may be invalid and cause the dump to abort.
Mar 07 19:19:28 galera-test01 mysqld[28431]: Query (0x7f50d541f020): GRANT USAGE ON *.* TO test_user@localhost IDENTIFIED BY 'random_password'
Mar 07 19:19:28 galera-test01 mysqld[28431]: Connection ID (thread ID): 3
Mar 07 19:19:28 galera-test01 mysqld[28431]: Status: NOT_KILLED
Mar 07 19:19:28 galera-test01 mysqld[28431]: 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
Mar 07 19:19:28 galera-test01 mysqld[28431]: The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
Mar 07 19:19:28 galera-test01 mysqld[28431]: information that should help you find out what is causing the crash.
Mar 07 19:19:28 galera-test01 systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
Mar 07 19:19:28 galera-test01 systemd[1]: Unit mariadb.service entered failed state.
Mar 07 19:19:28 galera-test01 systemd[1]: mariadb.service failed.

I think crashing here is not intended, but I would be fine with an error if GRANT + wsrep_forced_binlog_format=ROW is not supported.



 Comments   
Comment by Andrew Garner [ 2016-03-07 ]

Apologies, I had missed MDEV-9401 when I looked before reporting this issue. This is obviously a duplicate.

Comment by Elena Stepanova [ 2016-03-07 ]

Thanks for the report.

Stack trace from 10.1 debug build commit 33d298493df7659f17c7825ee17ecb068402d29a

mysqld: /src/10.1/sql/sql_acl.cc:6470: bool mysql_grant(THD*, const char*, List<st_lex_user>&, ulong, bool, bool): Assertion `!thd->is_current_stmt_binlog_format_row()' failed.
160307 21:42:11 [ERROR] mysqld got signal 6 ;
 
#7  0x00007fcf041bc1d2 in __assert_fail () from /lib64/libc.so.6
#8  0x000056384e51a448 in mysql_grant (thd=0x7fcee0a7b070, db=0x0, list=..., rights=0, revoke_grant=false, is_proxy=false) at /src/10.1/sql/sql_acl.cc:6470
#9  0x000056384e5a219d in mysql_execute_command (thd=0x7fcee0a7b070) at /src/10.1/sql/sql_parse.cc:4752
#10 0x000056384e5a98e2 in mysql_parse (thd=0x7fcee0a7b070, rawbuf=0x7fcef0a32388 "GRANT USAGE ON *.* TO test_user@localhost IDENTIFIED BY 'random_password'", length=73, parser_state=0x7fcf06429630) at /src/10.1/sql/sql_parse.cc:7336
#11 0x000056384e5982dd in dispatch_command (command=COM_QUERY, thd=0x7fcee0a7b070, packet=0x7fcee0a92771 "GRANT USAGE ON *.* TO test_user@localhost IDENTIFIED BY 'random_password'", packet_length=73) at /src/10.1/sql/sql_parse.cc:1488
#12 0x000056384e59700f in do_command (thd=0x7fcee0a7b070) at /src/10.1/sql/sql_parse.cc:1109
#13 0x000056384e6ccc38 in do_handle_one_connection (thd_arg=0x7fcee0a7b070) at /src/10.1/sql/sql_connect.cc:1349
#14 0x000056384e6cc99c in handle_one_connection (arg=0x7fcee0a7b070) at /src/10.1/sql/sql_connect.cc:1261
#15 0x00007fcf061050a4 in start_thread () from /lib64/libpthread.so.0
#16 0x00007fcf0427304d in clone () from /lib64/libc.so.6

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