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

Assertion `found' failed in remove_ptr_from_dynarray after failed CREATE OR REPLACE

Details

    Description

      CREATE ROLE r;
      CREATE USER foo;
      --error ER_PLUGIN_IS_NOT_LOADED
      CREATE OR REPLACE USER foo IDENTIFIED WITH non_existing_plugin;
      DROP ROLE r;
       
      # Cleanup
      # It does not really exist after failed CREATE OR REPLACE, but just in case
      DROP USER IF EXISTS foo;
      

      10.4 fac997feef0

      mysqld: /data/src/10.4/sql/sql_acl.cc:3057: void remove_ptr_from_dynarray(DYNAMIC_ARRAY*, void*): Assertion `found' failed.
      181209  0:35:40 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f8d13b55ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000055c581e6fda6 in remove_ptr_from_dynarray (array=0x7f8cfc137198, ptr=0x55c5843d90c0) at /data/src/10.4/sql/sql_acl.cc:3057
      #9  0x000055c581e855ff in handle_grant_struct (struct_no=ROLE_ACL, drop=true, user_from=0x7f8cfc014e30, user_to=0x0) at /data/src/10.4/sql/sql_acl.cc:9514
      #10 0x000055c581e86666 in handle_grant_data (thd=0x7f8cfc000b00, tables=..., drop=true, user_from=0x7f8cfc014e30, user_to=0x0) at /data/src/10.4/sql/sql_acl.cc:10017
      #11 0x000055c581e871c8 in mysql_drop_user (thd=0x7f8cfc000b00, list=..., handle_as_role=true) at /data/src/10.4/sql/sql_acl.cc:10246
      #12 0x000055c581f3685c in mysql_execute_command (thd=0x7f8cfc000b00) at /data/src/10.4/sql/sql_parse.cc:5406
      #13 0x000055c581f3e9b0 in mysql_parse (thd=0x7f8cfc000b00, rawbuf=0x7f8cfc014da8 "DROP ROLE r", length=11, parser_state=0x7f8d0dcfc600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8092
      #14 0x000055c581f2bc8e in dispatch_command (command=COM_QUERY, thd=0x7f8cfc000b00, packet=0x7f8cfc00b411 "DROP ROLE r", packet_length=11, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
      #15 0x000055c581f2a6b2 in do_command (thd=0x7f8cfc000b00) at /data/src/10.4/sql/sql_parse.cc:1396
      #16 0x000055c5820961a0 in do_handle_one_connection (connect=0x55c5844000e0) at /data/src/10.4/sql/sql_connect.cc:1402
      #17 0x000055c582095f24 in handle_one_connection (arg=0x55c5844000e0) at /data/src/10.4/sql/sql_connect.cc:1308
      #18 0x000055c58254d41a in pfs_spawn_thread (arg=0x55c5843601e0) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #19 0x00007f8d15611494 in start_thread (arg=0x7f8d0dcfd700) at pthread_create.c:333
      #20 0x00007f8d13c1293f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Not reproducible on 10.3 or on a slightly older 10.4, although I didn't bisect for the exact revision.

      Attachments

        Activity

          elenst Elena Stepanova created issue -
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          Description {code:sql}
          CREATE ROLE r;
          CREATE USER foo;
          --error ER_PLUGIN_IS_NOT_LOADED
          CREATE OR REPLACE USER foo IDENTIFIED WITH non_existing_plugin;
          DROP ROLE r;

          # Cleanup
          # It does not really exist after failed CREATE OR REPLACE, but just in case
          DROP USER IF EXISTS foo;
          {code}

          {noformat:title=10.4 fac997feef0}
          mysqld: /data/src/10.4/sql/sql_acl.cc:3057: void remove_ptr_from_dynarray(DYNAMIC_ARRAY*, void*): Assertion `found' failed.
          181209 0:35:40 [ERROR] mysqld got signal 6 ;

          #7 0x00007f8d13b55ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
          #8 0x000055c581e6fda6 in remove_ptr_from_dynarray (array=0x7f8cfc137198, ptr=0x55c5843d90c0) at /data/src/10.4/sql/sql_acl.cc:3057
          #9 0x000055c581e855ff in handle_grant_struct (struct_no=ROLE_ACL, drop=true, user_from=0x7f8cfc014e30, user_to=0x0) at /data/src/10.4/sql/sql_acl.cc:9514
          #10 0x000055c581e86666 in handle_grant_data (thd=0x7f8cfc000b00, tables=..., drop=true, user_from=0x7f8cfc014e30, user_to=0x0) at /data/src/10.4/sql/sql_acl.cc:10017
          #11 0x000055c581e871c8 in mysql_drop_user (thd=0x7f8cfc000b00, list=..., handle_as_role=true) at /data/src/10.4/sql/sql_acl.cc:10246
          #12 0x000055c581f3685c in mysql_execute_command (thd=0x7f8cfc000b00) at /data/src/10.4/sql/sql_parse.cc:5406
          #13 0x000055c581f3e9b0 in mysql_parse (thd=0x7f8cfc000b00, rawbuf=0x7f8cfc014da8 "DROP ROLE r", length=11, parser_state=0x7f8d0dcfc600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8092
          #14 0x000055c581f2bc8e in dispatch_command (command=COM_QUERY, thd=0x7f8cfc000b00, packet=0x7f8cfc00b411 "DROP ROLE r", packet_length=11, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
          #15 0x000055c581f2a6b2 in do_command (thd=0x7f8cfc000b00) at /data/src/10.4/sql/sql_parse.cc:1396
          #16 0x000055c5820961a0 in do_handle_one_connection (connect=0x55c5844000e0) at /data/src/10.4/sql/sql_connect.cc:1402
          #17 0x000055c582095f24 in handle_one_connection (arg=0x55c5844000e0) at /data/src/10.4/sql/sql_connect.cc:1308
          #18 0x000055c58254d41a in pfs_spawn_thread (arg=0x55c5843601e0) at /data/src/10.4/storage/perfschema/pfs.cc:1862
          #19 0x00007f8d15611494 in start_thread (arg=0x7f8d0dcfd700) at pthread_create.c:333
          #20 0x00007f8d13c1293f in clone () from /lib/x86_64-linux-gnu/libc.so.6
          {noformat}
          {code:sql}
          CREATE ROLE r;
          CREATE USER foo;
          --error ER_PLUGIN_IS_NOT_LOADED
          CREATE OR REPLACE USER foo IDENTIFIED WITH non_existing_plugin;
          DROP ROLE r;

          # Cleanup
          # It does not really exist after failed CREATE OR REPLACE, but just in case
          DROP USER IF EXISTS foo;
          {code}

          {noformat:title=10.4 fac997feef0}
          mysqld: /data/src/10.4/sql/sql_acl.cc:3057: void remove_ptr_from_dynarray(DYNAMIC_ARRAY*, void*): Assertion `found' failed.
          181209 0:35:40 [ERROR] mysqld got signal 6 ;

          #7 0x00007f8d13b55ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
          #8 0x000055c581e6fda6 in remove_ptr_from_dynarray (array=0x7f8cfc137198, ptr=0x55c5843d90c0) at /data/src/10.4/sql/sql_acl.cc:3057
          #9 0x000055c581e855ff in handle_grant_struct (struct_no=ROLE_ACL, drop=true, user_from=0x7f8cfc014e30, user_to=0x0) at /data/src/10.4/sql/sql_acl.cc:9514
          #10 0x000055c581e86666 in handle_grant_data (thd=0x7f8cfc000b00, tables=..., drop=true, user_from=0x7f8cfc014e30, user_to=0x0) at /data/src/10.4/sql/sql_acl.cc:10017
          #11 0x000055c581e871c8 in mysql_drop_user (thd=0x7f8cfc000b00, list=..., handle_as_role=true) at /data/src/10.4/sql/sql_acl.cc:10246
          #12 0x000055c581f3685c in mysql_execute_command (thd=0x7f8cfc000b00) at /data/src/10.4/sql/sql_parse.cc:5406
          #13 0x000055c581f3e9b0 in mysql_parse (thd=0x7f8cfc000b00, rawbuf=0x7f8cfc014da8 "DROP ROLE r", length=11, parser_state=0x7f8d0dcfc600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8092
          #14 0x000055c581f2bc8e in dispatch_command (command=COM_QUERY, thd=0x7f8cfc000b00, packet=0x7f8cfc00b411 "DROP ROLE r", packet_length=11, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
          #15 0x000055c581f2a6b2 in do_command (thd=0x7f8cfc000b00) at /data/src/10.4/sql/sql_parse.cc:1396
          #16 0x000055c5820961a0 in do_handle_one_connection (connect=0x55c5844000e0) at /data/src/10.4/sql/sql_connect.cc:1402
          #17 0x000055c582095f24 in handle_one_connection (arg=0x55c5844000e0) at /data/src/10.4/sql/sql_connect.cc:1308
          #18 0x000055c58254d41a in pfs_spawn_thread (arg=0x55c5843601e0) at /data/src/10.4/storage/perfschema/pfs.cc:1862
          #19 0x00007f8d15611494 in start_thread (arg=0x7f8d0dcfd700) at pthread_create.c:333
          #20 0x00007f8d13c1293f in clone () from /lib/x86_64-linux-gnu/libc.so.6
          {noformat}

          Not reproducible on 10.3 or on a slightly older 10.4, although I didn't bisect for the exact revision.
          wlad Vladislav Vaintroub made changes -
          Affects Version/s 10.1 [ 16100 ]
          Affects Version/s 10.2 [ 14601 ]
          Affects Version/s 10.3 [ 22126 ]
          wlad Vladislav Vaintroub made changes -
          Fix Version/s 10.4 [ 22408 ]
          wlad Vladislav Vaintroub made changes -
          Fix Version/s 10.1 [ 16100 ]
          wlad Vladislav Vaintroub made changes -
          Fix Version/s 10.4.3 [ 23230 ]
          Fix Version/s 10.3.13 [ 23215 ]
          Fix Version/s 10.1.39 [ 23305 ]
          Fix Version/s 10.2.23 [ 23307 ]
          Fix Version/s 10.1 [ 16100 ]
          wlad Vladislav Vaintroub made changes -
          Fix Version/s 10.3.13 [ 23215 ]
          Fix Version/s 10.4.3 [ 23230 ]
          wlad Vladislav Vaintroub made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          elenst Elena Stepanova made changes -
          Fix Version/s 10.3.14 [ 23216 ]
          Fix Version/s 10.4.4 [ 23310 ]

          For the reference, non-debug build was failing with SIGSEGV:

          #2  <signal handler called>
          #3  show_role_grants (thd=<optimized out>, hostname=<optimized out>, acl_entry=0x7fe23a57e008, buff=<optimized out>, buffsize=<optimized out>, username=<optimized out>) at /data/src/10.1-bug/sql/sql_acl.cc:7982
          #4  0x0000559c7b5271f3 in mysql_show_grants (thd=0x7fe253399008, lex_user=0x7fe23a5050b0) at /data/src/10.1-bug/sql/sql_acl.cc:7876
          #5  0x0000559c7b572614 in mysql_execute_command (thd=0x7fe253399008) at /data/src/10.1-bug/sql/sql_parse.cc:4985
          #6  0x0000559c7b578a57 in mysql_parse (thd=0x7fe253399008, rawbuf=<optimized out>, length=<optimized out>, parser_state=0x7fe25a9b8620) at /data/src/10.1-bug/sql/sql_parse.cc:7468
          #7  0x0000559c7b57b5ff in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7fe253399008, packet=packet@entry=0x7fe247ba7009 "", packet_length=packet_length@entry=13) at /data/src/10.1-bug/sql/sql_parse.cc:1496
          #8  0x0000559c7b57bdc2 in do_command (thd=0x7fe253399008) at /data/src/10.1-bug/sql/sql_parse.cc:1124
          #9  0x0000559c7b639d5c in do_handle_one_connection (thd_arg=thd_arg@entry=0x7fe253399008) at /data/src/10.1-bug/sql/sql_connect.cc:1330
          #10 0x0000559c7b639f17 in handle_one_connection (arg=arg@entry=0x7fe253399008) at /data/src/10.1-bug/sql/sql_connect.cc:1242
          #11 0x0000559c7b8b4854 in pfs_spawn_thread (arg=0x7fe257c3ec08) at /data/src/10.1-bug/storage/perfschema/pfs.cc:1861
          #12 0x00007fe25a649494 in start_thread (arg=0x7fe25a9b9b00) at pthread_create.c:333
          #13 0x00007fe2587ea93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
          

          Apparently another representation of the same problem, as it was fixed by the same patch.

          elenst Elena Stepanova added a comment - For the reference, non-debug build was failing with SIGSEGV: #2 <signal handler called> #3 show_role_grants (thd=<optimized out>, hostname=<optimized out>, acl_entry=0x7fe23a57e008, buff=<optimized out>, buffsize=<optimized out>, username=<optimized out>) at /data/src/10.1-bug/sql/sql_acl.cc:7982 #4 0x0000559c7b5271f3 in mysql_show_grants (thd=0x7fe253399008, lex_user=0x7fe23a5050b0) at /data/src/10.1-bug/sql/sql_acl.cc:7876 #5 0x0000559c7b572614 in mysql_execute_command (thd=0x7fe253399008) at /data/src/10.1-bug/sql/sql_parse.cc:4985 #6 0x0000559c7b578a57 in mysql_parse (thd=0x7fe253399008, rawbuf=<optimized out>, length=<optimized out>, parser_state=0x7fe25a9b8620) at /data/src/10.1-bug/sql/sql_parse.cc:7468 #7 0x0000559c7b57b5ff in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7fe253399008, packet=packet@entry=0x7fe247ba7009 "", packet_length=packet_length@entry=13) at /data/src/10.1-bug/sql/sql_parse.cc:1496 #8 0x0000559c7b57bdc2 in do_command (thd=0x7fe253399008) at /data/src/10.1-bug/sql/sql_parse.cc:1124 #9 0x0000559c7b639d5c in do_handle_one_connection (thd_arg=thd_arg@entry=0x7fe253399008) at /data/src/10.1-bug/sql/sql_connect.cc:1330 #10 0x0000559c7b639f17 in handle_one_connection (arg=arg@entry=0x7fe253399008) at /data/src/10.1-bug/sql/sql_connect.cc:1242 #11 0x0000559c7b8b4854 in pfs_spawn_thread (arg=0x7fe257c3ec08) at /data/src/10.1-bug/storage/perfschema/pfs.cc:1861 #12 0x00007fe25a649494 in start_thread (arg=0x7fe25a9b9b00) at pthread_create.c:333 #13 0x00007fe2587ea93f in clone () from /lib/x86_64-linux-gnu/libc.so.6 Apparently another representation of the same problem, as it was fixed by the same patch.
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 91121 ] MariaDB v4 [ 155328 ]

          People

            wlad Vladislav Vaintroub
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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