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

SIGSEGV in get_loc_info on DROP TABLE in connection w/ Audit Plugin

    XMLWordPrintable

Details

    Description

      Related to MDEV-34074, however this bug does not reproduce in 10.5, and the crashing query differs.

      CREATE TABLE t (c INT) ENGINE=InnoDB;
      INSERT INTO t VALUES (1);
      INSTALL PLUGIN server_audit SONAME 'server_audit';
      UNINSTALL PLUGIN server_audit;
      XA START 'a';
      SET GLOBAL lock_wait_timeout=0;
      SET GLOBAL innodb_stats_persistent=DEFAULT;
      INSERT INTO t VALUES (2);
      XA END 'a';
      SET pseudo_slave_mode=1;
      XA PREPARE 'a';
      INSERT INTO t VALUES (3),(4);
      INSTALL PLUGIN server_audit SONAME 'server_audit';
      DROP TABLE t;
      

      Leads to:

      CS 12.1.0 4b79d7b8ee557d53a859aedec839b8673585b514 (Debug) Build 06/06/2025

      Core was generated by `/test/MD060625-mariadb-12.1.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x00007f3b65163f5a in get_loc_info (thd=0x7f3adc002148)at /test/12.1_dbg/plugin/server_audit/server_audit.c:1012
       
      [Current thread is 1 (LWP 171714)]
      (gdb) bt
      #0  0x00007f3b65163f5a in get_loc_info (thd=0x7f3adc002148)at /test/12.1_dbg/plugin/server_audit/server_audit.c:1012
      #1  0x00007f3b65163ac3 in auditing (thd=0x7f3adc002148, event_class=0, ev=0x7f3afbe9e8b0)at /test/12.1_dbg/plugin/server_audit/server_audit.c:2307
      #2  0x000055a182c5bf21 in plugins_dispatch (thd=0x7f3adc002148, plugin=0x7f3adc001488, arg=0x7f3afbe9e860)at /test/12.1_dbg/sql/sql_audit.cc:398
      #3  0x000055a182c5be70 in mysql_audit_notify (thd=0x7f3adc002148, event_class=0, event=0x7f3afbe9e8b0) at /test/12.1_dbg/sql/sql_audit.cc:437
      #4  0x000055a1828f9c78 in mysql_audit_general (thd=0x7f3adc002148, event_subtype=1, error_code=1205, msg=0x7f3afbe9ef90 "Lock wait timeout exceeded; try restarting transaction") at /test/12.1_dbg/sql/sql_audit.h:212
      #5  0x000055a1828f9864 in THD::raise_condition (this=0x7f3adc002148, cond=0x7f3afbe9eca0) at /test/12.1_dbg/sql/sql_class.cc:1155
      #6  0x000055a18256e8da in THD::raise_condition (this=0x7f3adc002148, sql_errno=1205, sqlstate=0x55a181d34cb8 "", level=Sql_state_errno_level::WARN_LEVEL_ERROR, msg=0x7f3afbe9ef90 "Lock wait timeout exceeded; try restarting transaction") at /test/12.1_dbg/sql/sql_class.h:5425
      #7  0x000055a182555505 in my_message_sql (error=1205, str=0x7f3afbe9ef90 "Lock wait timeout exceeded; try restarting transaction", MyFlags=0) at /test/12.1_dbg/sql/mysqld.cc:3384
      #8  0x000055a1834ca24b in my_error (nr=1205, MyFlags=0)at /test/12.1_dbg/mysys/my_error.c:124
      #9  0x000055a182c70f6f in MDL_context::acquire_lock (this=0x7f3adc002360, mdl_request=0x7f3afbe9f340, lock_wait_timeout=0)at /test/12.1_dbg/sql/mdl.cc:2332
      #10 0x000055a18301bc8c in dict_acquire_mdl_shared<false> (table=0x7f3a7c029bd8, mdl_context=0x7f3adc002360, mdl=0x7f3afbe9f980, table_op=DICT_TABLE_OP_NORMAL)at /test/12.1_dbg/storage/innobase/dict/dict0dict.cc:667
      #11 0x000055a18301c3c2 in dict_acquire_mdl_shared<false> (table=0x7f3a7c029bd8, thd=0x7f3adc002148, mdl=0x7f3afbe9f980, table_op=DICT_TABLE_OP_NORMAL)at /test/12.1_dbg/storage/innobase/dict/dict0dict.cc:801
      #12 0x000055a18300ae2d in dict_table_open_on_id (table_id=18, dict_locked=false, table_op=DICT_TABLE_OP_NORMAL, thd=0x7f3adc002148, mdl=0x7f3afbe9f980)at /test/12.1_dbg/storage/innobase/dict/dict0dict.cc:833
      #13 0x000055a18316781e in dict_stats_process_entry_from_recalc_pool (thd=0x7f3adc002148)at /test/12.1_dbg/storage/innobase/dict/dict0stats_bg.cc:302
      #14 0x000055a183167215 in dict_stats_func ()at /test/12.1_dbg/storage/innobase/dict/dict0stats_bg.cc:385
      #15 0x000055a183435844 in tpool::thread_pool_generic::timer_generic::run (this=0x55a18660cde0) at /test/12.1_dbg/tpool/tpool_generic.cc:336
      #16 0x000055a1834353ad in tpool::thread_pool_generic::timer_generic::execute (arg=0x55a18660cde0) at /test/12.1_dbg/tpool/tpool_generic.cc:356
      #17 0x000055a1834395cf in tpool::task::execute (this=0x55a18660ce20)at /test/12.1_dbg/tpool/task.cc:37
      #18 0x000055a18343224b in tpool::thread_pool_generic::worker_main (this=0x55a185b3f370, thread_var=0x55a186558fc0)at /test/12.1_dbg/tpool/tpool_generic.cc:574
      #19 0x000055a183436d44 in std::__invoke_impl<void, void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*>(__f=@0x55a185b59298: (void (tpool::thread_pool_generic::*)(class tpool::thread_pool_generic * const, struct tpool::worker_data *)) 0x55a183432140 <tpool::thread_pool_generic::worker_main(tpool::worker_data*)>, __t=@0x55a185b59290: 0x55a185b3f370, __args=@0x55a185b59288: 0x55a186558fc0)at /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/invoke.h:74
      #20 0x000055a183436c65 in std::__invoke<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> (__fn=@0x55a185b59298: (void (tpool::thread_pool_generic::*)(class tpool::thread_pool_generic * const, struct tpool::worker_data *)) 0x55a183432140 <tpool::thread_pool_generic::worker_main(tpool::worker_data*)>, __args=@0x55a185b59288: 0x55a186558fc0, __args=@0x55a185b59288: 0x55a186558fc0)at /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/invoke.h:96
      #21 0x000055a183436c33 in std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::_M_invoke<0ul, 1ul, 2ul> (this=0x55a185b59288)at /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_thread.h:292
      #22 0x000055a183436be5 in std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::operator() (this=0x55a185b59288)at /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_thread.h:299
      #23 0x000055a183436a59 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> > >::_M_run (this=0x55a185b59280)at /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_thread.h:244
      #24 0x00007f3b716eabb4 in std::execute_native_thread_routine (__p=0x55a185b59280)at ../../../../../src/libstdc++-v3/src/c++11/thread.cc:104
      #25 0x00007f3b7129ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #26 0x00007f3b71329c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed   
      CS  10.5   dbg  091124  7afee25b08bf801a97ce3246bb604d388572eace  No bug found
      CS  10.6   dbg  060625  643319a7fb1e273797c2a1e46d76cfac0fa1da8f  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      CS  10.6   opt  060625  643319a7fb1e273797c2a1e46d76cfac0fa1da8f  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      CS  10.11  dbg  060625  11d1ac7285221ab4df7d9ef7cc8ee949b01c9b32  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      CS  10.11  opt  060625  11d1ac7285221ab4df7d9ef7cc8ee949b01c9b32  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      CS  11.4   dbg  060625  8c6cbb336081a5e1ad781df4a9778b61e3b4d73f  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      CS  11.4   opt  060625  8c6cbb336081a5e1ad781df4a9778b61e3b4d73f  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      CS  11.8   dbg  060625  67e6fdee05ead4974fe632e91c38941ade369b0c  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      CS  11.8   opt  060625  67e6fdee05ead4974fe632e91c38941ade369b0c  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      CS  12.0   dbg  060625  f1102da37a3dcdc8b92e0205f0a8bd878704b168  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      CS  12.0   opt  060625  f1102da37a3dcdc8b92e0205f0a8bd878704b168  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      CS  12.1   dbg  060625  4b79d7b8ee557d53a859aedec839b8673585b514  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      CS  12.1   opt  060625  4b79d7b8ee557d53a859aedec839b8673585b514  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      ES  10.5   dbg  060625  ec7bc4f84e490b25f52db7422a1e0e8bbea72fb1  No bug found                  
      ES  10.5   opt  060625  ec7bc4f84e490b25f52db7422a1e0e8bbea72fb1  No bug found                  
      ES  10.6   dbg  060625  8541ea1e4c2fa15789dd162f6ba4b32681f74e61  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      ES  10.6   opt  060625  8541ea1e4c2fa15789dd162f6ba4b32681f74e61  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      ES  11.4   dbg  060625  1c8b2d3059f5ccb67c042868baca3ee269c6eca7  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      ES  11.4   opt  060625  1c8b2d3059f5ccb67c042868baca3ee269c6eca7  SIGSEGV|get_loc_info|auditing|plugins_dispatch|mysql_audit_notify
      MS  5.5    dbg  070123  bac287c315b1792e7ae33f91add6a60292f9bae8  No bug found                  
      MS  5.5    opt  070123  bac287c315b1792e7ae33f91add6a60292f9bae8  No bug found                  
      MS  5.6    dbg  070123  dab95781a1244104d6b87020ac2fc4d190ba2946  No bug found                  
      MS  5.6    opt  070123  dab95781a1244104d6b87020ac2fc4d190ba2946  No bug found                  
      MS  5.7    dbg  070525  f7680e98b6bbe3500399fbad465d08a6b75d7a5c  No bug found                  
      MS  5.7    opt  070525  f7680e98b6bbe3500399fbad465d08a6b75d7a5c  No bug found                  
      MS  8.0    dbg  060224  49ef33f7edadef3ae04665e73d1babd40179a4f1  No bug found, thread hang detected
      MS  8.0    opt  060224  49ef33f7edadef3ae04665e73d1babd40179a4f1  No bug found, thread hang detected
      MS  9.1    dbg  211024  61a3a1d8ef15512396b4c2af46e922a19bf2b174  No bug found, thread hang detected
      MS  9.1    opt  211024  61a3a1d8ef15512396b4c2af46e922a19bf2b174  No bug found, thread hang detected
      

      The issue is not present in CS/ES 10.5:

      CS 10.5.28 7afee25b08bf801a97ce3246bb604d388572eace (Debug) Build 09/11/2024

      10.5.28-dbg>DROP TABLE t;
      Query OK, 0 rows affected (0.005 sec)
      

      ES 10.5.29-23 ec7bc4f84e490b25f52db7422a1e0e8bbea72fb1 (Debug) Build 06/06/2025

      10.5.29-dbg>DROP TABLE t;
      Query OK, 0 rows affected (0.007 sec)
      

      Attachments

        Issue Links

          Activity

            People

              bnestere Brandon Nesterenko
              Roel Roel Van de Paar
              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.