Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Possible bug with FastMM and DbExpress

Help
2012-01-18
2013-05-23
  • Hi.

    I'm working on an application where we have to exchange data of all kind (Including objects) between a dll and a host application, the data is passed as parameters of dynamically called functions.

    As the library would be freed before the application, we would be unable to get the full stack trace of dll generated leaks. We fixed this by creating an interface unit for the dll's functions forcing the dll to be loaded sooner (Some methods are still being called dynamically).
    Doing this way the dll is the owner of the memory manager and the application has to use the MM shared by the dll. When the application shuts down we have a full stack of all leaks.

    However, every time a connection is made through a TSQLConnection, the leak report isn't generated.
    Looking inside the finalization routine I found that the problem occurs when the MM is freeing the medium blocks. So far thats all I know about this bug.

    I made a sample code that reproduces this problem. You can download it here: http://www.francisschiavo.com/Delphi/FastMM/DbExpress/Sample.zip

    To reproduce the bug, just click on the "Run Test" button and then connect to any database. You'll see that if you do not connect to a database the report will be generated showing some leaks I left.

    If anybody has an idea of what is hapening I would really appreciate some advices.

    Note: I tested this with Oracle and a generic Odbc connection, but I'm pretty sure it has nothing to do with the driver.

    Regards,
    Francis Schiavo