Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-40960

Assertion `strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0' failed

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.11, 11.4, 11.8, 12.3, 13.0, 13.1
    • 10.11, 11.4, 11.8, 12.3, 13.0
    • Server
    • None
    • Can result in hang or crash

    Description

      CLI compatible test case

      set sql_mode='';
      GRANT PROXY ON u1@u2 TO u1@u2,u2@u2;
      DELETE FROM mysql.global_priv;
      FLUSH PRIVILEGES;
      CREATE USER u1@u1,u1@u2;
      RENAME USER u1@u2 TO u2@u2;
      GRANT USAGE ON *.* TO u2@u2;
      

      Leads to:

      CS 13.0.2 be111d2cd60d035d555b71da019765cfb42ea0d3 (Debug, Clang 22.1.8-20260621) Build 21/08/2026

      mariadbd: /test/13.0_dbg/sql/sql_acl.cc:3230: size_t find_first_user(T *, size_t, const char *) [T = ACL_USER]: Assertion `strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0' failed.
      

      CS 13.0.2 be111d2cd60d035d555b71da019765cfb42ea0d3 (Debug, Clang 22.1.8-20260621) Build 21/08/2026

      Core was generated by `/test/MD210826-mariadb-13.0.2-linux-x86_64-dbg/bin/mariadbd --no-defaults --loo'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 2485605)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x000070c1f684527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000070c1f68288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000070c1f682881b in __assert_fail_base (fmt=0x70c1f69d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x60441c7f8b20 "strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0", file=file@entry=0x60441c7f76fc "/test/13.0_dbg/sql/sql_acl.cc", line=line@entry=3230, function=function@entry=0x60441c7f8e40 "size_t find_first_user(T *, size_t, const char *) [T = ACL_USER]") at ./assert/assert.c:96
      #6  0x000070c1f683b517 in __assert_fail (assertion=0x60441c7f8b20 "strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0", file=0x60441c7f76fc "/test/13.0_dbg/sql/sql_acl.cc", line=3230, function=0x60441c7f8e40 "size_t find_first_user(T *, size_t, const char *) [T = ACL_USER]") at ./assert/assert.c:105
      #7  0x000060441b761793 in find_first_user<ACL_USER> (arr=0x68c0e0034640, len=2, user=0x68c0e001a4c0 "u2") at /test/13.0_dbg/sql/sql_acl.cc:3230
      #8  0x000060441b74f8a3 in acl_find_user_by_name (user=0x68c0e001a4c0 "u2")at /test/13.0_dbg/sql/sql_acl.cc:3249
      #9  0x000060441b73444b in find_user_exact (host=@0x68c0e001a4f0: {str = 0x68c0e001a510 "u2", length = 2}, user=@0x68c0e001a4e0: {str = 0x68c0e001a4c0 "u2", length = 2})at /test/13.0_dbg/sql/sql_acl.cc:4590
      #10 0x000060441b738508 in replace_user_table (thd=0x68c0e0000d60, user_table=@0x70c1d0057ea0: {<Grant_table_base> = {_vptr$Grant_table_base = 0x60441d0f7b60 <vtable for User_table_json+16>, min_columns = 3, start_priv_columns = 0, end_priv_columns = 3, pk_parts = 2, m_table = 0x60443942c890, static _vtable$ = <optimized out>}, static _vtable$ = <optimized out>}, combo=0x68c0e001a4e0, rights=NO_ACL, revoke_grant=false, can_create_user=true, no_auto_create=false)at /test/13.0_dbg/sql/sql_acl.cc:4993
      #11 0x000060441b74829d in mysql_grant (thd=0x68c0e0000d60, db={str = 0x0, length = 0}, list=@0x68c0e0006228: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x68c0e001a520, last = 0x68c0e001a520, elements = 1}, <No data fields>}, rights=NO_ACL, revoke_grant=false, is_proxy=false)at /test/13.0_dbg/sql/sql_acl.cc:8141
      #12 0x000060441b748d10 in Sql_cmd_grant_table::execute_table_mask (this=0x68c0e001a530, thd=0x68c0e0000d60)at /test/13.0_dbg/sql/sql_acl.cc:12743
      #13 0x000060441b748dca in Sql_cmd_grant_table::execute (this=0x68c0e001a530, thd=0x68c0e0000d60) at /test/13.0_dbg/sql/sql_acl.cc:12760
      #14 0x000060441b835c06 in mysql_execute_command (thd=0x68c0e0000d60, is_called_from_prepared_stmt=false) at /test/13.0_dbg/sql/sql_parse.cc:5905
      #15 0x000060441b826d18 in mysql_parse (thd=0x68c0e0000d60, rawbuf=0x68c0e001a3c0 "GRANT USAGE ON *.* TO u2@u2", length=27, parser_state=0x70c1d00599f0) at /test/13.0_dbg/sql/sql_parse.cc:7943
      #16 0x000060441b82446e in dispatch_command (command=COM_QUERY, thd=0x68c0e0000d60, packet=0x68c0e000b5f1 "GRANT USAGE ON *.* TO u2@u2", packet_length=27, blocking=true) at /test/13.0_dbg/sql/sql_parse.cc:1903
      #17 0x000060441b82779a in do_command (thd=0x68c0e0000d60, blocking=true)at /test/13.0_dbg/sql/sql_parse.cc:1437
      #18 0x000060441b9f975e in do_handle_one_connection (connect=0x60443949c710, put_in_cache=true) at /test/13.0_dbg/sql/sql_connect.cc:1514
      #19 0x000060441b9f9541 in handle_one_connection (arg=0x60443947b070)at /test/13.0_dbg/sql/sql_connect.cc:1426
      #20 0x000070c1f689cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #21 0x000070c1f6929d6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.11  dbg  210826  6415902490b1b0a9a500cee9bc0a41c342190605  strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0|SIGABRT|find_first_user<ACL_USER>|acl_find_user_by_name|find_user_exact|replace_user_table
      CS  10.11  opt  210826  6415902490b1b0a9a500cee9bc0a41c342190605  No bug found                  
      CS  11.4   dbg  210826  1a052f27e374fc9b4cb5b1fd098cf10f0e1381cc  strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0|SIGABRT|find_first_user<ACL_USER>|acl_find_user_by_name|find_user_exact|replace_user_table
      CS  11.4   opt  210826  1a052f27e374fc9b4cb5b1fd098cf10f0e1381cc  No bug found                  
      CS  11.8   dbg  210826  d26f9ab217a7fcf9d4eccc62c01020ff275ff42e  strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0|SIGABRT|find_first_user<ACL_USER>|acl_find_user_by_name|find_user_exact|replace_user_table
      CS  11.8   opt  210826  d26f9ab217a7fcf9d4eccc62c01020ff275ff42e  No bug found                  
      CS  12.3   dbg  210826  add63991988734383c5e942de2a19c6c45f511f7  strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0|SIGABRT|find_first_user<ACL_USER>|acl_find_user_by_name|find_user_exact|replace_user_table
      CS  12.3   opt  210826  add63991988734383c5e942de2a19c6c45f511f7  No bug found                  
      CS  13.0   dbg  210826  be111d2cd60d035d555b71da019765cfb42ea0d3  strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0|SIGABRT|find_first_user<ACL_USER>|acl_find_user_by_name|find_user_exact|replace_user_table
      CS  13.0   opt  210826  be111d2cd60d035d555b71da019765cfb42ea0d3  No bug found                  
      CS  13.1   dbg  210826  ff09eefbe4e8b57846435ee4a928f17e49f0fdfc  strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0|SIGABRT|find_first_user<ACL_USER>|acl_find_user_by_name|find_user_exact|replace_user_table
      CS  13.1   opt  210826  ff09eefbe4e8b57846435ee4a928f17e49f0fdfc  No bug found                  
      ES  10.6   dbg  210826  fcecb2620f25965723d640decede7c018bcb1dcc  strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0|SIGABRT|find_first_user<ACL_USER>|acl_find_user_by_name|find_user_exact|replace_user_table
      ES  10.6   opt  210826  fcecb2620f25965723d640decede7c018bcb1dcc  No bug found                  
      ES  11.4   dbg  210826  3b34189bfe675c18c4ced3ef531d016ea74c76f4  strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0|SIGABRT|find_first_user<ACL_USER>|acl_find_user_by_name|find_user_exact|replace_user_table
      ES  11.4   opt  210826  3b34189bfe675c18c4ced3ef531d016ea74c76f4  No bug found                  
      ES  11.8   dbg  210826  4694e931d10fecf733c34f83ea2146d31b708eb3  strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0|SIGABRT|find_first_user<ACL_USER>|acl_find_user_by_name|find_user_exact|replace_user_table
      ES  11.8   opt  210826  4694e931d10fecf733c34f83ea2146d31b708eb3  No bug found                  
      ES  12.3   dbg  210826  f513f503feacabfb219d4a6f965b5f72b86d4db0  strcmp(arr[i].get_username(), arr[i + 1].get_username()) <= 0|SIGABRT|find_first_user<ACL_USER>|acl_find_user_by_name|find_user_exact|replace_user_table
      ES  12.3   opt  210826  f513f503feacabfb219d4a6f965b5f72b86d4db0  No bug found                  
      

      Attachments

        Activity

          People

            serg Sergei Golubchik
            saahil Saahil Alam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 1.5h
                1.5h

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.