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

Memory leak in mysqltest on connect failure

Details

    Description

      --error ER_ACCESS_DENIED_ERROR
      connect (fail_con,localhost,root,z,test2);
      

      In such cased mysql_close() is not called while it should. That results in a test failures under clang + ASAN/LSAN. F.ex. main.connect is affected.

      Attachments

        Activity

          I fix this in 10.3 because I suspect only I'm affected by this bug. Should it be fixed in earlier versions too?

          kevg Eugene Kosov (Inactive) added a comment - I fix this in 10.3 because I suspect only I'm affected by this bug. Should it be fixed in earlier versions too?

          Let's decide that after the review.
          And no, you're not the only one affected, I suspect everyone who builds with ASAN and runs tests is affected. I certainly am too.

          and I wouldn't call it a bug, I think it was a conscious design decision to exit() from just anywhere in mysqltest.c

          serg Sergei Golubchik added a comment - Let's decide that after the review. And no, you're not the only one affected, I suspect everyone who builds with ASAN and runs tests is affected. I certainly am too. and I wouldn't call it a bug, I think it was a conscious design decision to exit() from just anywhere in mysqltest.c
          kevg Eugene Kosov (Inactive) added a comment - - edited

          > And no, you're not the only one affected

          Fine. That means patch is more useful than I've thought

          > and I wouldn't call it a bug, I think it was a conscious design decision to exit() from just anywhere in mysqltest.c

          Ok. But I do not understand how it's related to this issues case.

          kevg Eugene Kosov (Inactive) added a comment - - edited > And no, you're not the only one affected Fine. That means patch is more useful than I've thought > and I wouldn't call it a bug, I think it was a conscious design decision to exit() from just anywhere in mysqltest.c Ok. But I do not understand how it's related to this issues case.

          I'd rather move mysql_close() to the caller. Because it's the caller that allocates memory, so it's the caller that should free it.
          I hope you're ok with it.

          serg Sergei Golubchik added a comment - I'd rather move mysql_close() to the caller. Because it's the caller that allocates memory, so it's the caller that should free it. I hope you're ok with it.

          Looks like I'm too late to improve patch. Thanks for the review!

          kevg Eugene Kosov (Inactive) added a comment - Looks like I'm too late to improve patch. Thanks for the review!

          People

            serg Sergei Golubchik
            kevg Eugene Kosov (Inactive)
            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.