Bug #7576 | MyODBC leaking handles | ||
---|---|---|---|
Submitted: | 29 Dec 2004 15:22 | Modified: | 25 Feb 2005 16:04 |
Reporter: | Robert Lindgren | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / ODBC | Severity: | S1 (Critical) |
Version: | 3.51.10 | OS: | Windows (windows) |
Assigned to: | Vasily Kishkin | CPU Architecture: | Any |
[29 Dec 2004 15:22]
Robert Lindgren
[31 Dec 2004 21:22]
MySQL Verification Team
Can you provide a test case without to involve envox ? This will help us a lot for to try to repeat the behavior reported. Thanks in advance.
[1 Jan 2005 1:57]
Robert Lindgren
As this has been reported more than 2 years ago with a test case, written in C I guessed you had the case provided by Envox at that time still available but that isn't the case I guess? I'll try to find something out. It's strange that you cannot see the problem from the odbc trace file.
[1 Jan 2005 4:07]
MySQL Verification Team
Hi Robert, The person who handled that case isn't not works longer with us, and I would prefer to run a test case against Purify than just a trace log file analyze. Thanks.
[1 Jan 2005 22:11]
Robert Lindgren
Ok, I understand, the problem I have is that I don't have the small c program which where refered to in the earlier mailinglist discussion. So I thought that you might be having it since it's your list. But it looks like the attached files are not viewable from the web any longer. What I do have is an Envox system proving the problem, but as it's not that many people having Envox installed for some reason :) I do understand that you would like me to provide some c-code proving the problem. I'll try to find something during next week.
[3 Jan 2005 12:55]
Robert Lindgren
Here is a note from one Envox developer made in the earlier talks between Envox and MySQL back in 2001/2002. What I don't really get from this note is, if he is talking about MyODBC version or if it's the server version. Anyway it leaks as much when connecting to a 4.1.8 server. I've been discussing with the MySQL developers and they tell me that the handles-leak problem will not be solved in 3.51.03, but in 4.1. This will most likely take some time before it is released and by knowing this, Envox and MySQL can't be used together. (Will eventually crash). Just wanted to inform you about this and make the suggestion to use MSDE instead which can be found on your MSoffice CD or MSSQL. Background: Memory leak exist only when SQLExecuteDirect() (i.e. SQLExecute() and SQLPrepare()) is executed from separated thread (which is a requirement for our software). If it is executed in the same thread, memory leak would not appear. -----------
[3 Jan 2005 14:20]
MySQL Verification Team
Hi Robert, The below text you posted: Background: Memory leak exist only when SQLExecuteDirect() (i.e. SQLExecute() and SQLPrepare()) is executed from separated thread (which is a requirement for our software). If it is executed in the same thread, memory leak would not appear. Gives me a guess what is happens: the my_thread_end() isn't called when additional threads are used in the same connection, then handle leaks occurs for every additional thread. How I am not sure and I don't have their application to test I would like to know if you are able for to test an MyODBC dll it will be provided with the patch ? Thanks in advance.
[3 Jan 2005 14:27]
Robert Lindgren
Yeah I would be more than happy to test a patch. As soon as possible is the best time for me to test it :)
[4 Jan 2005 23:36]
MySQL Verification Team
Ok. Thanks I will wait just for the next release Connector/ODBC for Windows (it will be into 1 week). Then I will build the dll for your test.
[5 Jan 2005 7:14]
Robert Lindgren
When I run the Envox environment in Purify I see that for each dbopen-select-close there is one handle, a semaphore, left open, and it's myodbc3.dll that is indicated to be the dll using the semaphore. The semaphore is never closed. More and more are allocated for each query.
[5 Jan 2005 11:25]
Robert Lindgren
Uploaded some examples, showing handle leak problem that we are seeing. You'll need to change dsn and query I guess. But since it's a simple example that shouldn't be that hard. I've watched thread leakage with process explorer. http://www.sysinternals.com/ntw2k/freeware/procexp.shtml The threaded examples leak one handle per query.
[6 Jan 2005 19:12]
MySQL Verification Team
Hi Robert, I installed the 3.51.10-2 Connector/ODBC driver and tested the sample: db_test_thread.c and Purify showed me just potential leaks. Please update you driver with that and let me know what you find. That driver you can get from our download site. Thanks in advance.
[7 Jan 2005 8:25]
Robert Lindgren
Well have you tried the db_test_thread10k.c? Run that and check memory usage of the process, please understand that the problem doesn't show up in purify at least not that obvious (but I've not used purify before so it might be good, but it sure doesn't do a good job in this case), please run the program I was recommended, processexplorer. I don't know why purify doesn't show the leak, well it does, a new handle is used in every run in the db_test_thread, but in the 10k version it's more obvious that the program leaks like h*ll. So please test the db_test_thread10k and tell how much memory that has used up compared to when it started. Since this problem has been around since 2001 I regard this as quite serious problem. And it's vital for us to get this leak out of the way, otherwise we'll have to stay with Oracle, which I guess we don't want, and in this case you neither.
[7 Jan 2005 8:29]
Robert Lindgren
Why doesn't the status change when I do a edit submission?
[7 Jan 2005 9:08]
Robert Lindgren
Showing memory usage when running the 10k threaded version.
Attachment: my_leak1.JPG (image/jpeg, text), 194.38 KiB.
[16 Jan 2005 22:46]
Harun Eren
Hi, I think this bug #7576 is in relationship with bug description in issue #2776 (Memory leak in Connector/ODBC ? ! ). Best Regards
[17 Jan 2005 7:38]
Robert Lindgren
I can't se how http://bugs.mysql.com/bug.php?id=2776 relates to this problem? And I'm not able to find a bug called (Memory leak in Connector/ODBC ? ! ). So please guide me to the right place so that I can read the description of that bug.
[1 Feb 2005 15:14]
Robert Lindgren
Same bug is present in 3.51.11 also.
[12 Feb 2005 21:00]
Robert Lindgren
Looks to be fixed prerelease MyODBC 3.51.11-2, whhiiiwhoooo :) I'm happy again :) Will validate more deeply on monday morning.
[14 Feb 2005 15:28]
Robert Lindgren
It sure is fixed in 3.51.11-2. No more handle leaks. Thanks a bunch. You can now close this bug.
[14 Feb 2005 15:35]
MySQL Verification Team
Thank you for the update.