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

Assertion `grantee->counter > 0' failed in merge_role_privileges upon concurrent CREATE ROLE and FLUSH PRIVILEGES

    XMLWordPrintable

Details

    Description

      _Note: The test fails for me every time, but it employs a race condition, so it's still non-deterministic. Run with --repeat=N if it doesn't fail right away. _
      Note: FLUSH TABLES isn't necessary for the scenario, the failure can happen without it; but somehow, it makes it much more probable.

      --connect (con1,localhost,root,,test)
      CREATE ROLE a;
      FLUSH TABLES;
       
      --connection default
      --send
        CREATE ROLE b WITH ADMIN a;
       
      --connection con1
      FLUSH PRIVILEGES;
       
      # Cleanup
      --disconnect con1
      --connection default
      --reap
      DROP ROLE a, b;
      

      10.0 4886d14827c

      mysqld: /data/src/10.0/sql/sql_acl.cc:5364: int merge_role_privileges(ACL_ROLE*, ACL_ROLE*, void*): Assertion `grantee->counter > 0' failed.
      181213 17:31:16 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f631ba80ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x00000000005d17e4 in merge_role_privileges (role=0x7f63158cc4f0, grantee=0x7f63158cc3e0, context=0x7f631d8ea7a0) at /data/src/10.0/sql/sql_acl.cc:5364
      #9  0x00000000005d0187 in traverse_role_graph_impl (user=0x7f63158cc4f0, context=0x7f631d8ea7a0, offset=88, on_node=0x0, on_edge=0x5d178b <merge_role_privileges(ACL_ROLE*, ACL_ROLE*, void*)>) at /data/src/10.0/sql/sql_acl.cc:4773
      #10 0x00000000005d03de in traverse_role_graph_up (role=0x7f63158cc4f0, context=0x7f631d8ea7a0, on_node=0x0, on_edge=0x5d178b <merge_role_privileges(ACL_ROLE*, ACL_ROLE*, void*)>) at /data/src/10.0/sql/sql_acl.cc:4838
      #11 0x00000000005d503a in propagate_role_grants_action (role_ptr=0x7f63158cc4f0, ptr=0x0) at /data/src/10.0/sql/sql_acl.cc:6568
      #12 0x0000000000e065ee in my_hash_iterate (hash=0x17e7200 <acl_roles>, action=0x5d4f87 <propagate_role_grants_action(void*, void*)>, argument=0x0) at /data/src/10.0/mysys/hash.c:770
      #13 0x00000000005d5846 in grant_reload (thd=0x7f6315aa8070) at /data/src/10.0/sql/sql_acl.cc:6651
      #14 0x000000000079a188 in reload_acl_and_cache (thd=0x7f6315aa8070, options=1, tables=0x0, write_to_binlog=0x7f631d8ec27c) at /data/src/10.0/sql/sql_reload.cc:84
      #15 0x0000000000652d7b in mysql_execute_command (thd=0x7f6315aa8070) at /data/src/10.0/sql/sql_parse.cc:4309
      #16 0x00000000006589d0 in mysql_parse (thd=0x7f6315aa8070, rawbuf=0x7f6313c22088 "FLUSH PRIVILEGES", length=16, parser_state=0x7f631d8ec640) at /data/src/10.0/sql/sql_parse.cc:6637
      #17 0x000000000064b2f0 in dispatch_command (command=COM_QUERY, thd=0x7f6315aa8070, packet=0x7f6316fea071 "FLUSH PRIVILEGES", packet_length=16) at /data/src/10.0/sql/sql_parse.cc:1300
      #18 0x000000000064a5f0 in do_command (thd=0x7f6315aa8070) at /data/src/10.0/sql/sql_parse.cc:1003
      #19 0x000000000076bf08 in do_handle_one_connection (thd_arg=0x7f6315aa8070) at /data/src/10.0/sql/sql_connect.cc:1377
      #20 0x000000000076bc7a in handle_one_connection (arg=0x7f6315aa8070) at /data/src/10.0/sql/sql_connect.cc:1292
      #21 0x0000000000acdb54 in pfs_spawn_thread (arg=0x7f63159a2870) at /data/src/10.0/storage/perfschema/pfs.cc:1861
      #22 0x00007f631d569494 in start_thread (arg=0x7f631d8ed700) at pthread_create.c:333
      #23 0x00007f631bb3d93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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