[fpc-pascal] SQLdb: problem using GDB, but do not have memleak

Marcos Douglas md at delfire.net
Tue Mar 20 13:08:06 CET 2012


Hi,

I was testing the new connector to MSSQL when I found a problem.
If I compile and run in console, I have no memleak. Good. But if I put
a breakpoint in AConnection.Free; and press F8, I got this:

ERROR
,msg="Warning:\nCannot insert breakpoint -237.\nError accessing memory
address 0x7816cd30: Input/output error.\n"

I don't know if this problem happen just in new connector. I don't
have others DBMS installed here, justo MSSQLServer so, could you test
using another class to connect in other DBMS?

The code below is very simple (see http://wiki.freepascal.org/SqlDBHowto).
--------------------------------------------------------------------------------
program t1;

{$mode objfpc}{$H+}

uses
  heaptrc,
  Classes, SysUtils, DB, sqldb,
  mssqlconn; << change

var
  AConnection : TSQLConnection;

Procedure CreateConnection;
begin
  AConnection := TMSSQLConnection.Create(nil);  << change
  AConnection.Hostname := 'localhost';
  AConnection.DatabaseName := 'database';
  AConnection.UserName := 'user';
  AConnection.Password := '**********';
end;

begin
  CreateConnection;
  AConnection.Open;
  if Aconnection.Connected then
    writeln('Succesful connect!')
  else
    writeln('Error');
  AConnection.Close;
  AConnection.Free;  << breakpoint here
  writeln('done');
end.

My ENV is:
Lazarus 0.9.31 r36175 FPC 2.6.1 i386-win32-win32/win64

FPC
URL: http://svn.freepascal.org/svn/fpc/branches/fixes_2_6
Repository Root: http://svn.freepascal.org/svn/fpc
Repository UUID: 3ad0048d-3df7-0310-abae-a5850022a9f2
Revision: 20521
Node Kind: directory
Schedule: normal
Last Changed Author: marco
Last Changed Rev: 20519
Last Changed Date: 2012-03-15 09:18:24 -0300 (Thu, 15 Mar 2012)

GDB
URL: http://svn.freepascal.org/svn/lazarus/binaries
Repository Root: http://svn.freepascal.org/svn/lazarus
Repository UUID: 4005530d-fff6-0310-9dd1-cebe43e6787f
Revision: 36176
Node Kind: directory
Schedule: normal
Last Changed Author: martin
Last Changed Rev: 32524
Last Changed Date: 2011-09-27 13:23:25 -0300 (Tue, 27 Sep 2011)
--------------------------------------------------------------------------------

Thanks,
Marcos Douglas



More information about the fpc-pascal mailing list