[MDEV-16658] Memory leak in mysqltest on connect failure Created: 2018-07-02  Updated: 2019-01-24  Resolved: 2019-01-24

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients, Tests
Affects Version/s: 10.3.7
Fix Version/s: 10.1.38, 5.5.63, 10.0.38, 10.2.22, 10.3.13

Type: Bug Priority: Minor
Reporter: Eugene Kosov (Inactive) Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None


 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.



 Comments   
Comment by Eugene Kosov (Inactive) [ 2018-07-02 ]

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

Comment by Sergei Golubchik [ 2018-07-02 ]

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

Comment by Eugene Kosov (Inactive) [ 2018-07-03 ]

> 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.

Comment by Sergei Golubchik [ 2019-01-23 ]

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.

Comment by Eugene Kosov (Inactive) [ 2019-01-24 ]

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

Generated at Thu Feb 08 08:30:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.