[unixODBC-support] Memory leaks in sql calls

Song, Cavin csong at Securify.com
Wed Oct 3 16:42:24 BST 2007


Nick,

I'm not srue how to figure out what driver is being used and how to
change it to another one, so if you cal tell me how to I'll try it. The
dmtest shows the following (not sure if this is what you are looking
for):

Available datasources:
        local (FreeTDS)
Available drivers:
        FreeTDS
                Attribute: Description=FreeTDS
                Attribute: Driver=/usr/local/lib/libtdsodbc.so.0
                Attribute: Setup=/usr/local/lib/libtdsS.so.1
                Attribute: FileUsage=1
                Attribute: CPTimeout=
                Attribute: CPReuse=

I have not used valgrind as I thought the problems might have been
fixed.

Cavin 

> -----Original Message-----
> From: unixodbc-support-bounces at easysoft.com 
> [mailto:unixodbc-support-bounces at easysoft.com] On Behalf Of 
> Nick Gorham
> Sent: Wednesday, October 03, 2007 1:19 AM
> To: Support for the unixODBC project
> Subject: Re: [unixODBC-support] Memory leaks in sql calls
> 
> Song, Cavin wrote:
> 
> >Hi Nick,
> >
> >Thanks for the quick reply. Yesterday I compiled and installed the 
> >latest odbc++ and unixodbc packages on my linux box:
> >
> >  libodbc++-0.2.4pre3
> >  unixODBC-2.2.11
> >
> >Then modified libodbc++-0.2.4pre3/tests/mysql.cpp to call 
> the existing
> >dropTables() function in mysql.cpp 6500 times and the leak 
> is about 20 
> >MB. Here is what I did to mysql.cpp:
> >
> >In main(), change the 1st dropTable() call to:
> >
> >  for (int i=0; i<6500; i++)
> >    dropTables(con.get());
> >  sleep(300);
> >
> >In other words, call dropTables() 6500 times (because dropTables() 
> >calls
> >dropTable() twice) and then sleep for 5 minutes so you have 
> time to run 
> >another cmd session to see the run-time size of mysql. The 
> leak size is 
> >pretty much consistent with what I found using the older 
> odbc libs. I'm 
> >not 100% sure but I think you should be able to reporduce 
> the problem 
> >on your machine.
> >
> >  
> >
> What driver are you using again?
> 
> Did you try using valgrind to see where the leak is happening?
> 
> Have you tried a different driver to see if the problem 
> happens in the driver?
> 
> --
> Nick Gorham
> Easysoft Limited
> http://www.easysoft.com, http://www.unixODBC.org
> 
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at easysoft.com
> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
> 



More information about the unixODBC-support mailing list