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

[Draft] LeakSanitizer: detected memory leaks

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4, 10.5
    • None
    • Replication
    • None
    • 20.04.1-Ubuntu aarch64

    Description

      During some testing, I saw variations of the following output with 10.4.26 and bb-10.5-andrei-MDEV-29322 commits after 1) installing a server from fresh, starting the server, and sending a few SQL commands via a bash script; 2) then manually starting a msyql connection via the command line and interacting with the server manually; 3) and after sending a quit; to exit:

      =================================================================
      ==2243452==ERROR: LeakSanitizer: detected memory leaks
       
      Direct leak of 130 byte(s) in 5 object(s) allocated from:
          #0 0xffff82c31540 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
          #1 0xffff82b1f668 in xmalloc (/lib/aarch64-linux-gnu/libreadline.so.5+0x2b668)
          #2 0xffff82b13ea8  (/lib/aarch64-linux-gnu/libreadline.so.5+0x1fea8)
          #3 0xffff82b14d1c in rl_message (/lib/aarch64-linux-gnu/libreadline.so.5+0x20d1c)
          #4 0xffff82b12c64  (/lib/aarch64-linux-gnu/libreadline.so.5+0x1ec64)
          #5 0xffff82b13540 in _rl_isearch_dispatch (/lib/aarch64-linux-gnu/libreadline.so.5+0x1f540)
          #6 0xffff82b139f8  (/lib/aarch64-linux-gnu/libreadline.so.5+0x1f9f8)
          #7 0xffff82b05edc in _rl_dispatch_subseq (/lib/aarch64-linux-gnu/libreadline.so.5+0x11edc)
          #8 0xffff82b0618c in readline_internal_char (/lib/aarch64-linux-gnu/libreadline.so.5+0x1218c)
          #9 0xffff82b06818 in readline (/lib/aarch64-linux-gnu/libreadline.so.5+0x12818)
          #10 0xaaaaaf16bb70 in read_and_execute /home/parallels/dev/10.4.26/client/mysql.cc:2089
          #11 0xaaaaaf169464 in main /home/parallels/dev/10.4.26/client/mysql.cc:1281
          #12 0xffff822afd4c in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x20d4c)
          #13 0xaaaaaf1670a4  (/home/parallels/dev/10.4.26/build1/bin/mysql+0xd70a4)
       
      Direct leak of 23 byte(s) in 1 object(s) allocated from:
          #0 0xffff82c31540 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
          #1 0xffff82b1f668 in xmalloc (/lib/aarch64-linux-gnu/libreadline.so.5+0x2b668)
          #2 0xffff82b13ea8  (/lib/aarch64-linux-gnu/libreadline.so.5+0x1fea8)
          #3 0xffff82b14d1c in rl_message (/lib/aarch64-linux-gnu/libreadline.so.5+0x20d1c)
          #4 0xffff82b12c64  (/lib/aarch64-linux-gnu/libreadline.so.5+0x1ec64)
          #5 0xffff82b139d4  (/lib/aarch64-linux-gnu/libreadline.so.5+0x1f9d4)
          #6 0xffff82b05edc in _rl_dispatch_subseq (/lib/aarch64-linux-gnu/libreadline.so.5+0x11edc)
          #7 0xffff82b0618c in readline_internal_char (/lib/aarch64-linux-gnu/libreadline.so.5+0x1218c)
          #8 0xffff82b06818 in readline (/lib/aarch64-linux-gnu/libreadline.so.5+0x12818)
          #9 0xaaaaaf16bb70 in read_and_execute /home/parallels/dev/10.4.26/client/mysql.cc:2089
          #10 0xaaaaaf169464 in main /home/parallels/dev/10.4.26/client/mysql.cc:1281
          #11 0xffff822afd4c in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x20d4c)
          #12 0xaaaaaf1670a4  (/home/parallels/dev/10.4.26/build1/bin/mysql+0xd70a4)
       
      SUMMARY: AddressSanitizer: 153 byte(s) leaked in 6 allocation(s).
      

      The number of bytes leaked and allocations seemed to increase the longer the connection was open (which did not necessarily correlate with the number of commands sent).

      The failure was originally seen with a few servers set up for replication, but I have been able to reproduce the error with only one server and sending some very simple commands (again, manually/interactively at the command line).

      I will try to create an MTR test case for this, but it could be this leak is a consequence of my environment and/or the bash script I am using.

      Attachments

        Activity

          People

            angelique.sklavounos Angelique Sklavounos (Inactive)
            angelique.sklavounos Angelique Sklavounos (Inactive)
            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.