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

          kevg Eugene Kosov (Inactive) created issue -
          kevg Eugene Kosov (Inactive) made changes -
          Field Original Value New Value
          Description {code:sql
          --error ER_ACCESS_DENIED_ERROR
          connect (fail_con,localhost,root,z,test2);
          {code}

          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.
          {code:sql}
          --error ER_ACCESS_DENIED_ERROR
          connect (fail_con,localhost,root,z,test2);
          {code}

          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.
          kevg Eugene Kosov (Inactive) made changes -
          Component/s Tests [ 10800 ]
          kevg Eugene Kosov (Inactive) made changes -
          Status Open [ 1 ] In Progress [ 3 ]

          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?
          kevg Eugene Kosov (Inactive) made changes -
          Assignee Eugene Kosov [ kevg ] Sergei Golubchik [ serg ]
          Status In Progress [ 3 ] In Review [ 10002 ]

          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
          serg Sergei Golubchik made changes -
          Fix Version/s 10.3 [ 22126 ]
          serg Sergei Golubchik made changes -
          Priority Minor [ 4 ] Major [ 3 ]
          serg Sergei Golubchik made changes -
          Priority Major [ 3 ] Minor [ 4 ]
          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.
          serg Sergei Golubchik made changes -
          Fix Version/s 5.5 [ 15800 ]
          Fix Version/s 10.0 [ 16000 ]
          Fix Version/s 10.1 [ 16100 ]
          Fix Version/s 10.2 [ 14601 ]

          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.
          serg Sergei Golubchik made changes -
          Status In Review [ 10002 ] Stalled [ 10000 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.1.38 [ 23209 ]
          Fix Version/s 5.5.63 [ 23210 ]
          Fix Version/s 10.0.38 [ 23211 ]
          Fix Version/s 10.3.13 [ 23215 ]
          Fix Version/s 10.2.22 [ 23250 ]
          Fix Version/s 10.2 [ 14601 ]
          Fix Version/s 5.5 [ 15800 ]
          Fix Version/s 10.0 [ 16000 ]
          Fix Version/s 10.1 [ 16100 ]
          Fix Version/s 10.3 [ 22126 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]

          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!
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 88179 ] MariaDB v4 [ 154611 ]

          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.