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

Server crashes when executing the FLUSH PRIVILEGES statement after starting the server with skip-grant-tables and creating the mysql.host table

    XMLWordPrintable

Details

    Description

      --let $restart_parameters=--skip-grant-tables=1
      --source include/restart_mysqld.inc
       
      CREATE TABLE mysql.host (c INT);
      FLUSH PRIVILEGES;
       
      # cleanup
      DROP TABLE mysql.host;
      

      Leads to:

      CS 12.1.2 8ea46c7197266695c6048d6c27053839130c5244 (Optimized, Clang 18.1.3-11) Build 09/10/2025

      Core was generated by `/test/MD091025-mariadb-12.1.2-linux-x86_64-opt/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x000063060dd824a7 in pfs_unlock_mutex_v1 (mutex=0xa322e6f732e3436)at /test/12.1_opt/storage/perfschema/pfs.cc:3667
       
      [Current thread is 1 (LWP 558240)]
      (gdb) bt
      #0  0x000063060dd824a7 in pfs_unlock_mutex_v1 (mutex=0xa322e6f732e3436)at /test/12.1_opt/storage/perfschema/pfs.cc:3667
      #1  0x000063060d81a168 in inline_mysql_mutex_unlock (that=0x6306258c0928)at /test/12.1_opt/include/mysql/psi/mysql_thread.h:786
      #2  GRANT_NAME::GRANT_NAME (this=this@entry=0x7faaf4007cc0, form=form@entry=0x7faaf4072758, is_routine=false)at /test/12.1_opt/sql/sql_acl.cc:5701
      #3  0x000063060d81a1c1 in GRANT_TABLE::GRANT_TABLE (this=0xa322e6f732e3436, this@entry=0x7faaf4007cc0, form=0xa322e6f732e3436, form@entry=0x7faaf4072758, col_privs=col_privs@entry=0x7faaf4085448)at /test/12.1_opt/sql/sql_acl.cc:5734
      #4  0x000063060d81fd6c in grant_load (thd=0x7faaf4000c68, tables_priv=@0x7fc9cc5409a0: {<Grant_table_base> = {_vptr$Grant_table_base = 0x63060e9c2f80 <vtable for Tables_priv_table+16>, min_columns = 8, start_priv_columns = 0, end_priv_columns = 8, pk_parts = 4, m_table = 0x7faaf4072758}, <No data fields>}, columns_priv=@0x7fc9cc5409c0: {<Grant_table_base> = {_vptr$Grant_table_base = 0x63060e9c2fb8 <vtable for Columns_priv_table+16>, min_columns = 7, start_priv_columns = 0, end_priv_columns = 7, pk_parts = 5, m_table = 0x7faaf4085448}, <No data fields>}, procs_priv=@0x7fc9cc540a00: {<Grant_table_base> = {_vptr$Grant_table_base = 0x63060e9c3028 <vtable for Procs_priv_table+16>, min_columns = 8, start_priv_columns = 0, end_priv_columns = 8, pk_parts = 5, m_table = 0x7faaf40961a8}, <No data fields>}) at /test/12.1_opt/sql/sql_acl.cc:8283
      #5  grant_reload (thd=thd@entry=0x7faaf4000c68)at /test/12.1_opt/sql/sql_acl.cc:8439
      #6  0x000063060d9f761e in reload_acl_and_cache (thd=thd@entry=0x7faaf4000c68, options=1, tables=tables@entry=0x0, write_to_binlog=write_to_binlog@entry=0x7fc9cc540ff0)at /test/12.1_opt/sql/sql_reload.cc:101
      #7  0x000063060d8b525a in mysql_execute_command (thd=thd@entry=0x7faaf4000c68, is_called_from_prepared_stmt=false) at /test/12.1_opt/sql/sql_parse.cc:5327
      #8  0x000063060d8ae471 in mysql_parse (thd=thd@entry=0x7faaf4000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7fc9cc541420)at /test/12.1_opt/sql/sql_parse.cc:7885
      #9  0x000063060d8ac98f in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7faaf4000c68, packet=packet@entry=0x7faaf4008a09 "FLUSH PRIVILEGES", packet_length=packet_length@entry=16, blocking=true)at /test/12.1_opt/sql/sql_parse.cc:1878
      #10 0x000063060d8ae881 in do_command (thd=thd@entry=0x7faaf4000c68, blocking=true) at /test/12.1_opt/sql/sql_parse.cc:1417
      #11 0x000063060d9d8ffd in do_handle_one_connection (connect=<optimized out>, connect@entry=0x6306258bba38, put_in_cache=true)at /test/12.1_opt/sql/sql_connect.cc:1503
      #12 0x000063060d9d8dbf in handle_one_connection (arg=arg@entry=0x6306258bba38)at /test/12.1_opt/sql/sql_connect.cc:1415
      #13 0x000063060dd80ea9 in pfs_spawn_thread (arg=0x6306258bf5e8)at /test/12.1_opt/storage/perfschema/pfs.cc:2198
      #14 0x00007fc9d5e9caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #15 0x00007fc9d5f29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.6   dbg  061025  d891d23ec33fb8432b7cd9bf90b8a5b41fdbab42  MARIADBD_ERROR|mariadbd: Fatal error: mysql.host table is damaged or in unsupported 3.20 format
      CS  10.6   opt  061025  d891d23ec33fb8432b7cd9bf90b8a5b41fdbab42  MARIADBD_ERROR|mariadbd: Fatal error: mysql.host table is damaged or in unsupported 3.20 format
      CS  10.11  dbg  061025  b1c29632565a594074d9b6c9f3a33dcaca4f508d  SIGSEGV|__strlen_evex|safe_mutex_lock|inline_mysql_mutex_lock|GRANT_NAME::GRANT_NAME
      CS  10.11  opt  061025  b1c29632565a594074d9b6c9f3a33dcaca4f508d  SIGSEGV|pfs_unlock_mutex_v1|inline_mysql_mutex_unlock|GRANT_NAME::GRANT_NAME|GRANT_TABLE::GRANT_TABLE
      CS  11.4   dbg  061025  5b72e95a8c6f8d11854472ada393d248c20e253b  SIGSEGV|__strlen_evex|safe_mutex_lock|inline_mysql_mutex_lock|GRANT_NAME::GRANT_NAME
      CS  11.4   opt  061025  5b72e95a8c6f8d11854472ada393d248c20e253b  SIGSEGV|pfs_unlock_mutex_v1|inline_mysql_mutex_unlock|GRANT_NAME::GRANT_NAME|GRANT_TABLE::GRANT_TABLE
      CS  11.8   dbg  061025  8916aeed28af19a7f4d6ff2ab5f33190a2c9fcd2  SIGSEGV|__strlen_evex|safe_mutex_lock|inline_mysql_mutex_lock|GRANT_NAME::GRANT_NAME
      CS  11.8   opt  061025  8916aeed28af19a7f4d6ff2ab5f33190a2c9fcd2  SIGSEGV|pfs_unlock_mutex_v1|inline_mysql_mutex_unlock|GRANT_NAME::GRANT_NAME|GRANT_TABLE::GRANT_TABLE
      CS  12.1   dbg  091025  8ea46c7197266695c6048d6c27053839130c5244  SIGSEGV|__strlen_evex|safe_mutex_lock|inline_mysql_mutex_lock|GRANT_NAME::GRANT_NAME                  
      CS  12.1   opt  091025  8ea46c7197266695c6048d6c27053839130c5244  SIGSEGV|pfs_unlock_mutex_v1|inline_mysql_mutex_unlock|GRANT_NAME::GRANT_NAME|GRANT_TABLE::GRANT_TABLE                  
      CS  12.2   dbg  290925  b8a77289639a3b10ada64cf892f02b5cecdb1603  MARIADBD_ERROR|mariadbd: Fatal error: mysql.host table is damaged or in unsupported 3.20 format
      CS  12.2   opt  290925  b8a77289639a3b10ada64cf892f02b5cecdb1603  MARIADBD_ERROR|mariadbd: Fatal error: mysql.host table is damaged or in unsupported 3.20 format
      ES  10.5   dbg  040825  70586522eacf09d04d49962072e14325a75d8155  MARIADBD_ERROR|mariadbd: Fatal error: mysql.host table is damaged or in unsupported 3.20 format
      ES  10.5   opt  040825  70586522eacf09d04d49962072e14325a75d8155  MARIADBD_ERROR|mariadbd: Fatal error: mysql.host table is damaged or in unsupported 3.20 format
      ES  10.6   dbg  040825  9b794f34b48fb7eee490b6da44edc0f33a947447  MARIADBD_ERROR|mariadbd: Fatal error: mysql.host table is damaged or in unsupported 3.20 format
      ES  10.6   opt  040825  9b794f34b48fb7eee490b6da44edc0f33a947447  MARIADBD_ERROR|mariadbd: Fatal error: mysql.host table is damaged or in unsupported 3.20 format
      ES  11.4   dbg  040825  a1c03ccd54b582e75506687ee19b273ca897f261  MARIADBD_ERROR|mariadbd: Fatal error: mysql.host table is damaged or in unsupported 3.20 format
      ES  11.4   opt  040825  a1c03ccd54b582e75506687ee19b273ca897f261  MARIADBD_ERROR|mariadbd: Fatal error: mysql.host table is damaged or in unsupported 3.20 format
      

      10.6 and 12.2 versions shows table corrupt error when executing FLUSH PRIVILEGES

      ERROR 1728 (HY000): Cannot load from mysql.host. The table is probably corrupted
       
      Error info from error log
      mariadbd: Fatal error: mysql.host table is damaged or in unsupported 3.20 format
      

      Attachments

        Activity

          People

            serg Sergei Golubchik
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.