Bug #94743 Exception while closing mysql connection through C Connector
Submitted: 22 Mar 7:24 Modified: 22 Apr 15:14
Reporter: Bharathkumar Hegde Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S2 (Serious)
Version:latest OS:Microsoft Windows
Assigned to: CPU Architecture:Any
Tags: C_API, heap_corruption, MySQL, windows

[22 Mar 7:24] Bharathkumar Hegde
Description:
I am using C API library fro my windows application. Query execution completes, but running into an exception while closing mysql connection.

Here is the dump stack 

>	libmysql.dll!MEM_ROOT::Clear() Line 143	C++
 	libmysql.dll!free_root(MEM_ROOT * root, int flags) Line 262	C++
 	libmysql.dll!free_old_query(MYSQL * mysql) Line 1286	C++
 	libmysql.dll!mysql_close(MYSQL * mysql) Line 5215	C++
 	MySqlConnector.exe!MySqlInterface::~MySqlInterface() Line 352	C++
 	MySqlConnector.exe!main(int argc, char * * argv) Line 62	C++
 	[External Code]	

Using libmysql.dll built from latest code available in git. 

Application is throwing exception with c library packaged with MySQL 8.0.13 in windows.

How to repeat:
Build an application with c API, which initiates mysql connection, runs a query and closes the connection using 'mysql_close' function.

Suggested fix:
Find out the root cause for this heap corruption and fix it.
[22 Mar 15:14] Miguel Solorzano
Thank you for the bug report. Please specific the exactly version, currently the client library for Windows is the one shipped together with server in lib folde. Also attach a test case client version. Thanks in advance.
[23 Apr 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".