Bug #72141 Memory Leak?
Submitted: 27 Mar 2014 4:32 Modified: 14 Jun 2014 11:32
Reporter: andrew turnbull Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.3.1 OS:Windows
Assigned to: Bogdan Degtyariov CPU Architecture:Any

[27 Mar 2014 4:32] andrew turnbull
Description:
Clarification request. See private comments.

How to repeat:
execute any query
[31 Mar 2014 9:49] Bogdan Degtyariov
Hi Andrew,

Thanks for your interest in MySQL software.
Unfortunately, Windows lacks good tools for detecting memory leaks similar to valgrind in Unix/Linux systems. We do valgrind tests in these operating systems and they did not show memory leaks related to the code lines you indicated.

Please note that char *query is just a local variable pointing to an internal char* buffer inside (MY_PARSED_QUERY)stmt->query structure. The MY_PARSED_QUERY structure has other buffers that require the proper initialization and disposal. Therefore, you should be looking for the calls of delete_parsed_query() function, which actually frees the memory. We recently detected and fixed some other memory leaks, but this particular piece of code did not show any problems in our tests.

You can see the code for yourself and let me know if you still believe the problem exists.
[31 Mar 2014 9:52] andrew turnbull
Thanks very much. Are the recently detected leaks in the 5.3.1 code?
[31 Mar 2014 9:57] Bogdan Degtyariov
Andrew,

Yes, we detected and fixed three different memory leaks in Connector/ODBC 5.3 code line.

Unfortunately, I cannot disclose the change log or the release date for the new version 5.3.2. All I can say is that we expect it very soon.
[31 Mar 2014 10:00] andrew turnbull
That's very good. I have been plagued by myodbc leaks for years. I have long running applications that I have spent thousands of hours on looking for leaks. Most of them have turned out to be in the connector. 5.3.1 was the most stable yet in recent years so you are going in the right direction.
[31 Mar 2014 10:35] andrew turnbull
can you give me a hint on what causes the code to leak and if there is a work around?
[31 Mar 2014 10:36] andrew turnbull
By my last comment I mean can I code around it somehow?
[31 Mar 2014 10:50] Bogdan Degtyariov
Andrew,

Unfortunately, there is no work-arounds without the code changes in Connector/ODBC driver.

Coding the problem around is possible of course, but from my side it would be a public distribution of a new version code, which requires resolving issues related to the company policies and legal matters. In any case it is not a quick process. If my estimations are correct, a much faster option would be to wait a few days and get the verison 5.3.2 with all patches when it is published.

Sorry for the inconvenience.
[31 Mar 2014 10:57] Bogdan Degtyariov
So, since we had memory leaks in the version 5.3.1 I am preliminarily setting the "Verified" status.

It has to be re-checked again after the new version is released.
[31 Mar 2014 10:59] andrew turnbull
thank you for the information. I will wait for the release and see if it resolves my ongoing memory consumption. cheers.
[8 Apr 2014 3:56] andrew turnbull
Hi,

I see that connector/odbc 5.3.2 has moved into generally available release however the change log still says that it is not yet released and makes no mention of any leaks fixed. What is the real status? Is it released and are the leaks fixed?

cheers
[8 Apr 2014 6:45] Bogdan Degtyariov
Andrew,

I asked the documentation team to check the online changelog and publish the changes made for the version 5.3.2 (I know there is the new version of Changelog since I assisted the docs guys with preparing it).

Meanwhile you can check the Changelog file distributed with Connector/ODBC 5.3.2.
The file lists all the changes, features and fixed bugs.
[8 Apr 2014 6:48] andrew turnbull
Change log as per https://dev.mysql.com/doc/relnotes/connector-odbc/en/news-5-3-2.html

Changes in MySQL Connector/ODBC 5.3.2 (Not yet released)
Functionality Added or Changed

Made the Connector/ODBC GUI on Linux comply with the GNOME Coding Guidelines for Supporting Accessibility.

Added support for the connection flag DFLT_BIGINT_BIND_STR.

Bugs Fixed

Implemented a workaround for a control issue with GtkComboBox and GtkComboBoxEntry, in which the dialog control intercepted the keyboard signals, so that focus could be set to other controls using the keyboard.
[8 Apr 2014 7:19] Bogdan Degtyariov
Andrew,

I admitted that the problem exists with the online page. Therefore, I asked the documentation team to fix it (it might take a day or two).

Meanwhile, you can download the driver package (zip for instance) and look inside Changelog.txt file which is placed inside the package.

Since the changes are already available for public I am sending you the contents of Changelog.txt:

5.3.2

  Functionality added or changed:
  * Support of ODBCINSTGetProperties in MyODBC Driver (WL #7577)
  * Add DFLT_BIGINT_BIND_STR option to Connector/ODBC GUI (Windows and Linux)
    (WL#7579)
  * Accessibility features in Connector/ODBC Linux GUI (WL #7635)

  Bugs fixed:
  * Connect crash if the catalog name given to SQLSetConnectAttr is invalid
    (Bug #17587913)
  * Driver returns wrong length for output parameter streams
    (Bug #17814768/70946)
  * Assert failure in case of prepared statments and SQLDESCRIBECOL() called
    with column number given larger then actual parameter marker in query.
    (Bug #17311065)
  * SQLFOREIGNKEYS WITH FLAG_NO_INFORMATION_SCHEMA OPTION RETURNS BAD RESULTS 
    (Bug #16920750)
  * SQLFetch() crashing when execute using UnixODBC 2.3.2 (Bug #17857204)
  * Segmentation fault in SQLSpecialColumns if table name is invalid 
    (Bug# 17854697)
  * Invalid order of free() functions can cause crash (Bug# 17992912)
  * Crash in ODBC Driver with CHARSET=WRONGCHARSET (Bug# 17999659)
  * Driver and myodbc-installer crash with long option names (>100) and 
    values (>255) (Bug# 17966018)
  * ODBCManageDataSourcesQ4 cannot run MyODBC GUI setup to edit an existing
    DSN (Bug# 18046123)
  * SQLGetData returning error being called after SQLParamData (Bug #17842966)
  * Valgrind: jump or move depends on uninitialised value error from 
    myodbc-installer (Bug# 18046120)
  * Memory leak in sqlexecute() when connection is killed from another thread
    (Bug#17587617)
  * Data corruption in SQLBulkOperations because of buffer overrun.
    (Bug #17714172)
  * Segfault in SQLBulkOperations() for SQL_UPDATE_BY_BOOKMARK when select 
    returns 0 records. (Bug# 17714358)
  * MS Access crashed when sorting a column (Bug# 17071780/69550)
  * Empty query giving segmentation fault in myodbc_casecmp (Bug# 17085344)
  * Uninitialized variable free_value can set wrong error in SQLDescribeCol 
    (Bug# 17588101)
  * ODBC 5.2.5 DMG installer fails on OSX 10.8.5 (Bug #17512040/70422)
  * Bulk insert on time column with hour value > 99 gives error (Bug#17613161)
  * Concurrent execution of SQLEndTran() with SQL_HANDLE_ENV results in 
    SEG FAULT (Bug #18166331)
  * Workaround to GTK bug in GtkComboBox and GtkComboBoxEntry (WL #7637)
  * ODBC Driver GUI in Windows has wrong order of controls selection
    (Bug# 18240696)
  * Wrong installation library directory on some 64bit system other than x86_64.
    (Bug# 68848)
  * SQLNumResultCols() with NULL parameter results in Segmentation Fault
    (Bug# 18165197)
  * SQLBULKOPERATIONS(SQL_FETCH_BOOKMARK) RETURNS SQL_NO_DATA ERROR 
    (Bug# 18287216)
  * Segmentation Fault in SQLExecute() while executing test file "my_types"
    (Bug# 18303978)
  * Segmentation fault in SQLParamOptions() in Solaris platform (Bug# 18325878)
  * Segmentation fault in SQLForeignKeys() when number of columns in the table
    is more (Bug# 18286366)
  * Valgrind memory leak in SQLForeignKeys when NO_I_S=1 (Bug# 18286007)
  * Valgrind memory leak in when SQLPrepare used with SQLParamData/SQLPutData for
    NO_I_S=1 (Bug#18295317)
  * The password is getting saved when creating FileDSN using SQLDriverConnect
    (Bug# 18310873)
  * Passing NULL pointer to SQLSetDescField, SQLGetDiagField and SQLGetDiagRec
    results in a crash (Bug# 18431088)
[6 May 2014 9:28] Bogdan Degtyariov
Hi Andrew,

did you have a chance to test the recently released Connector/ODBC 5.3.2?
Thanks.
[12 May 2014 13:08] andrew turnbull
Am still testing and will get back to you. Thanks for following up
[15 Jun 2014 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".