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

InnoDB leaks memory for some static objects

Details

    Description

      InnoDB is leaking some memory for statically allocated objects. The leaks were caught by some changes to SAFEMALLOC that allow instrumenting operator new. I did not try to find out how to make AddressSanitizer report them.

      The impact is small, because the few dozen bytes will be freed by the operating system when the process is terminated. But, because memory leaks can be a telltale sign of subsystems not being closed down properly, we prefer to fix them.

      The leaks were identified by monty and cvicentiu.

      Attachments

        Issue Links

          Activity

            SAFEMALLOC performs it's check with std::atexit(). It really happens when destruction of static objects like fil_system_t fil_system happens. In our case sf_terminate() was called before the fil_system_t::~fil_system_t() was called. And a false positive was reported.

            kevg Eugene Kosov (Inactive) added a comment - SAFEMALLOC performs it's check with std::atexit() . It really happens when destruction of static objects like fil_system_t fil_system happens. In our case sf_terminate() was called before the fil_system_t::~fil_system_t() was called. And a false positive was reported.

            I agree that leak could be a too strong word for this. Some recovery-related memory in 10.5 was not being freed until shutdown. It was only a few hundred bytes, so this is not a big deal.

            Still, I think that it is useful to fix anything found by any instrumentation, because I remember some occurrences where AddressSanitizer does not report memory leak details while SAFEMALLOC would.

            marko Marko Mäkelä added a comment - I agree that leak could be a too strong word for this. Some recovery-related memory in 10.5 was not being freed until shutdown. It was only a few hundred bytes, so this is not a big deal. Still, I think that it is useful to fix anything found by any instrumentation, because I remember some occurrences where AddressSanitizer does not report memory leak details while SAFEMALLOC would.

            People

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