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

Memory leak in main.mysqladmin

    XMLWordPrintable

Details

    Description

      If you use cmake -DWITH_SAFEMALLOC=OFF -DWITH_ASAN=ON and run the following:

      ASAN_OPTIONS=abort_on_error=1 ./mtr main.mysqladmin
      

      then it will fail with the following:

      10.3 e9ba165bcbb9b913411b9a366a5f21d18e313de2

      CURRENT_TEST: main.mysqladmin
      mysqltest: At line 16: command "$MYSQLADMIN --database=db1 --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT  -u root --password= ping 2>&1" failed with wrong error: 134
      

      If you change the 2> redirect to a file, then that file will contain the following:

      10.3 e9ba165bcbb9b913411b9a366a5f21d18e313de2

      /dev/shm/10.3/client/mysqladmin: unknown variable 'database=db1'
       
      =================================================================
      ==6524==ERROR: LeakSanitizer: detected memory leaks
       
      Direct leak of 120 byte(s) in 1 object(s) allocated from:
          #0 0x4c8a7a in calloc (/dev/shm/10.3/client/mysqladmin+0x4c8a7a)
          #1 0x50acdf in mysql_init /mariadb/10.3/libmariadb/libmariadb/mariadb_lib.c:994:27
          #2 0x7f070a53409a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
       
      Direct leak of 4 byte(s) in 1 object(s) allocated from:
          #0 0x4c8a7a in calloc (/dev/shm/10.3/client/mysqladmin+0x4c8a7a)
          #1 0x50acb0 in mysql_init /mariadb/10.3/libmariadb/libmariadb/mariadb_lib.c:992:32
          #2 0x7f070a53409a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
       
      SUMMARY: AddressSanitizer: 124 byte(s) leaked in 2 allocation(s).
      Aborted
      

      Attachments

        Activity

          People

            serg Sergei Golubchik
            marko Marko Mäkelä
            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.