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

LeakSanitizer: detected memory leaks when shutting down the server after reading rows from all_plugins table

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6, 10.11, 11.2(EOL), 11.4, 11.6(EOL), 11.7(EOL)
    • 10.6, 10.11, 11.4
    • Plugins

    Description

      SELECT * FROM information_schema.all_plugins; 
      SHUTDOWN;
      

      Leads to

      CS 10.6.20 9849e3f948c7c0337220353fd34460b2f383a287 (Optimized, ASAN)

       
      =================================================================
      ==387059==ERROR: LeakSanitizer: detected memory leaks
       
      Direct leak of 240 byte(s) in 1 object(s) allocated from:
          #0 0x81706d in operator new(unsigned long) (/test/UBASAN_MD161024-mariadb-10.6.20-linux-x86_64-opt/bin/mariadbd+0x81706d)
          #1 0x1463a776ac3e  (<unknown module>)
          #2 0x1463a75ce1cf  (<unknown module>)
          #3 0x1463a7252360  (<unknown module>)
          #4 0x1463a694dd53  (<unknown module>)
          #5 0x1463cbe5cb99 in call_init /build/glibc-SzIz7B/glibc-2.31/elf/dl-init.c:72:3
       
      SUMMARY: AddressSanitizer: 240 byte(s) leaked in 1 allocation(s).
      241017  8:12:20 [ERROR] mysqld got signal 6 ;
      

      Setup:

      Compiled with clang version 10.0.0-4ubuntu1
      cmake . -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DWITH_SSL=bundled -DBUILD_CONFIG=mysql_release -DWITH_TOKUDB=0 -DWITH_JEMALLOC=no -DFEATURE_SET=community -DDEBUG_EXTNAME=OFF -DWITH_EMBEDDED_SERVER=0 -DENABLE_DOWNLOADS=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/tmp/boost_501206 -DENABLED_LOCAL_INFILE=1 -DENABLE_DTRACE=0 -DWITH_SAFEMALLOC=OFF -DPLUGIN_PERFSCHEMA=NO -DWITH_DBUG_TRACE=OFF -DWITH_ZLIB=bundled -DWITH_ROCKSDB=1 -DWITH_PAM=ON -DWITH_MARIABACKUP=0 -DFORCE_INSOURCE_BUILD=1 -DWITH_ASAN=ON -DWITH_ASAN_SCOPE=ON -DWSREP_LIB_WITH_ASAN=ON -DCMAKE_CXX_FLAGS=-fsanitize-coverage=trace-pc-guard -DMYSQL_MAINTAINER_MODE=OFF -DWARNING_AS_ERROR='' -DCMAKE_BUILD_TYPE=RelWithDebInfo
      

      Attachments

        Activity

          Another test case with different stack

          SET autocommit=0,foreign_key_checks=0,unique_checks=0;
          CREATE OR REPLACE TABLE t1(c1 SMALLINT NULL);
          INSERT INTO t1 (c1) VALUES(1),(1);
          SELECT COUNT(*) FROM information_schema.all_plugins;
          

          Leads to

          CS 10.6.20 9849e3f948c7c0337220353fd34460b2f383a287 (Optimized, UBASAN)

          Core was generated by `/test/UBASAN_MD161024-mariadb-10.6.20-linux-x86_64-opt/bin/mariadbd --no-defaul'.
          Program terminated with signal SIGSEGV, Segmentation fault.
          #0  0x0000000000807102 in __sanitizer_cov_trace_pc_guard ()
          [Current thread is 1 (Thread 0x14c6337f4700 (LWP 3382668))]
          (gdb) bt
          #0  0x0000000000807102 in __sanitizer_cov_trace_pc_guard ()
          #1  0x00000000013f18ec in handle_fatal_signal (sig=<optimized out>) at signal_handler.cc:137
          #2  <signal handler called>
          #3  0x0000000000807102 in __sanitizer_cov_trace_pc_guard ()
          #4  0x00000000022135d5 in fil_space_t::zip_size (flags=21) at include/fil0fil.h:726
          #5  fil_space_t::zip_size (this=<optimized out>) at include/fil0fil.h:750
          #6  btr_root_block_get (index=0x616000032df0, mode=RW_SX_LATCH, mtr=0x14c6337f2410, err=0x14c6337f2800) at btr/btr0btr.cc:282
          #7  0x0000000002370249 in dict_stats_analyze_index (index=0x616000032df0) at dict/dict0stats.cc:2702
          #8  0x000000000237e752 in dict_stats_update_persistent (table=0x61700001fff0) at dict/dict0stats.cc:3019
          #9  dict_stats_update (table=<optimized out>, stats_upd_option=<optimized out>) at dict/dict0stats.cc:4102
          #10 0x00000000023916bc in dict_stats_process_entry_from_recalc_pool (thd=0x62b0000af218) at dict/dict0stats_bg.cc:348
          #11 dict_stats_func () at dict/dict0stats_bg.cc:393
          #12 0x00000000024cc925 in tpool::thread_pool_generic::timer_generic::run (this=0x612000001240) at tpool_generic.cc:344
          #13 0x00000000024ce88d in tpool::task::execute (this=0x612000001280) at task.cc:37
          #14 0x00000000024c6b8a in tpool::thread_pool_generic::worker_main (this=0x618000000480, thread_var=<optimized out>) at tpool_generic.cc:583
          #15 0x000014c64a72cde4 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
          #16 0x000014c64a848609 in start_thread (arg=<optimized out>) at pthread_create.c:477
          #17 0x000014c64a55e133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
          

          ramesh Ramesh Sivaraman added a comment - Another test case with different stack SET autocommit=0,foreign_key_checks=0,unique_checks=0; CREATE OR REPLACE TABLE t1(c1 SMALLINT NULL ); INSERT INTO t1 (c1) VALUES (1),(1); SELECT COUNT (*) FROM information_schema.all_plugins; Leads to CS 10.6.20 9849e3f948c7c0337220353fd34460b2f383a287 (Optimized, UBASAN) Core was generated by `/test/UBASAN_MD161024-mariadb-10.6.20-linux-x86_64-opt/bin/mariadbd --no-defaul'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000000000807102 in __sanitizer_cov_trace_pc_guard () [Current thread is 1 (Thread 0x14c6337f4700 (LWP 3382668))] (gdb) bt #0 0x0000000000807102 in __sanitizer_cov_trace_pc_guard () #1 0x00000000013f18ec in handle_fatal_signal (sig=<optimized out>) at signal_handler.cc:137 #2 <signal handler called> #3 0x0000000000807102 in __sanitizer_cov_trace_pc_guard () #4 0x00000000022135d5 in fil_space_t::zip_size (flags=21) at include/fil0fil.h:726 #5 fil_space_t::zip_size (this=<optimized out>) at include/fil0fil.h:750 #6 btr_root_block_get (index=0x616000032df0, mode=RW_SX_LATCH, mtr=0x14c6337f2410, err=0x14c6337f2800) at btr/btr0btr.cc:282 #7 0x0000000002370249 in dict_stats_analyze_index (index=0x616000032df0) at dict/dict0stats.cc:2702 #8 0x000000000237e752 in dict_stats_update_persistent (table=0x61700001fff0) at dict/dict0stats.cc:3019 #9 dict_stats_update (table=<optimized out>, stats_upd_option=<optimized out>) at dict/dict0stats.cc:4102 #10 0x00000000023916bc in dict_stats_process_entry_from_recalc_pool (thd=0x62b0000af218) at dict/dict0stats_bg.cc:348 #11 dict_stats_func () at dict/dict0stats_bg.cc:393 #12 0x00000000024cc925 in tpool::thread_pool_generic::timer_generic::run (this=0x612000001240) at tpool_generic.cc:344 #13 0x00000000024ce88d in tpool::task::execute (this=0x612000001280) at task.cc:37 #14 0x00000000024c6b8a in tpool::thread_pool_generic::worker_main (this=0x618000000480, thread_var=<optimized out>) at tpool_generic.cc:583 #15 0x000014c64a72cde4 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #16 0x000014c64a848609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #17 0x000014c64a55e133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

          People

            sanja Oleksandr Byelkin
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.