[MDEV-24968] Assertion `magic < 1<<26' failed in get_magic_sort Created: 2021-02-24  Updated: 2021-04-15  Resolved: 2021-04-15

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: None
Fix Version/s: 10.6.0

Type: Bug Priority: Major
Reporter: Alice Sherepa Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-24312 master_host has 60 character limit, i... Closed

 Description   

create user u1@'host5678901_345678902_345678903_345678904_345678905_345678906_345678907%';

bb-10.6-MDEV-24312 414825b2e7f1e7a97

Version: '10.6.0-MariaDB-debug-log' 
mariadbd: /10.6/sql/sql_acl_getsort.ic:197: ulonglong get_magic_sort(const char*, ...): Assertion `magic < 1<<26' failed.
210224 13:45:56 [ERROR] mysqld got signal 6 ;
 
??:0(__interceptor_tcgetattr)[0x7f920f54cd30]
mysys/stacktrace.c:212(my_print_stacktrace)[0x5621168f44fd]
sql/signal_handler.cc:211(handle_fatal_signal)[0x5621153a99a4]
sigaction.c:0(__restore_rt)[0x7f920f0103c0]
linux/raise.c:51(__GI_raise)[0x7f920eafc18b]
stdlib/abort.c:81(__GI_abort)[0x7f920eadb859]
intl/loadmsgcat.c:509(get_sysdep_segment_value)[0x7f920eadb729]
:0(__GI___assert_fail)[0x7f920eaecf36]
sql/sql_acl_getsort.ic:198(get_magic_sort(char const*, ...))[0x56211498b92c]
sql/sql_acl.cc:3338(ACL_USER::ACL_USER(THD*, LEX_USER const&, Account_options const&, privilege_t))[0x562114994f42]
sql/sql_acl.cc:4620(replace_user_table(THD*, User_table const&, LEX_USER*, privilege_t, bool, bool, bool))[0x56211499f1a6]
sql/sql_acl.cc:10825(mysql_create_user(THD*, List<LEX_USER>&, bool))[0x5621149cf1d1]
sql/sql_parse.cc:5211(mysql_execute_command(THD*))[0x562114bba587]
sql/sql_parse.cc:7906(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x562114bcc9b7]
sql/sql_parse.cc:1835(dispatch_command(enum_server_command, THD*, char*, unsigned int))[0x562114ba354d]
sql/sql_parse.cc:1365(do_command(THD*))[0x562114ba041f]
sql/sql_connect.cc:1410(do_handle_one_connection(CONNECT*, bool))[0x562114fe2443]
sql/sql_connect.cc:1314(handle_one_connection)[0x562114fe1da7]
perfschema/pfs.cc:2203(pfs_spawn_thread)[0x562115ce5417]
nptl/pthread_create.c:478(start_thread)[0x7f920f004609]
x86_64/clone.S:97(__GI___clone)[0x7f920ebd8293]
 
Query (0x62b000085440): create user u1@'host5678901_345678902_345678903_345678904_345678905_345678906_345678907%'



 Comments   
Comment by Sergei Golubchik [ 2021-02-24 ]

The comment says

/*
  ...
  upper bound: L<=maxlen, M<=maxlen, K<=maxlen/2, P<maxlen
  for a current maxlen=64, the magic number needs 26 bits.
*/

It appears that for maxlen=255 the magic number will need 33 bits. Still fits in ulonglong.

Comment by Anel Husakovic [ 2021-04-15 ]

Fixed with the patch 95126d2f29e9b (jira is picking by the name of bb branches - which in this case is related to MDEV-24312).

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