Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-07

zeos and heaptrc (interfaces?)

7 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Luca Olivetti

I was trying to detect memory leaks, so I activated the -gh (use heaptrc) option in compiler options.
I left it activated and I added a zeos component (an sql query). As soon as I activate the query, the program exits (with no exceptions but a lot of heaptrc errors).
If I remove heaptrc the program works fine (and it doesn't appear to be leaking memory, btw).
I see that zeos extensively uses interfaces, maybe is there some problem using heaptrc with interfaces?

Bye

Luca Olivetti Wetron Automatizaci?n S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007

Reply by email

Boguslaw Brandys
to Luca Olivetti

Yes.I saw that too.Try to turn on range check and other and you will see memory overrun errors detected.I don't know if they are really memory leaks or just incompatipility with heaptrace

Regards
Boguslaw

Earlier message 22 lines
----- Original Message ----- From: "Luca Olivetti" To: Sent: Monday, July 07, 2008 9:18 AM Subject: [Lazarus] zeos and heaptrc (interfaces?) I was trying to detect memory leaks, so I activated the -gh (use heaptrc) option in compiler options. I left it activated and I added a zeos component (an sql query). As soon as I activate the query, the program exits (with no exceptions but a lot of heaptrc errors). If I remove heaptrc the program works fine (and it doesn't appear to be leaking memory, btw). I see that zeos extensively uses interfaces, maybe is there some problem using heaptrc with interfaces? Bye -- Luca Olivetti Wetron Automatizaci?n S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007

Reply by email

Joao Morais
to Luca Olivetti: I was trying to detect memory leaks, so I activated the -gh (use heaptrc) option in…
Luca Olivetti wrote 9 lines
I was trying to detect memory leaks, so I activated the -gh (use heaptrc) option in compiler options. I left it activated and I added a zeos component (an sql query). As soon as I activate the query, the program exits (with no exceptions but a lot of heaptrc errors). If I remove heaptrc the program works fine (and it doesn't appear to be leaking memory, btw). I see that zeos extensively uses interfaces, maybe is there some problem using heaptrc with interfaces?

I am also using refcounted interfaces and observed several leaks with 2.2.0, which disapeared a couple of weeks ago with branches_2_2. What is your fpc version?

Joao Morais

Reply by email

Luca Olivetti
to Joao Morais

En/na Joao Morais ha escrit:

Show quoted text 14 lines
Luca Olivetti wrote: > I was trying to detect memory leaks, so I activated the -gh (use > heaptrc) option in compiler options. > I left it activated and I added a zeos component (an sql query). > As soon as I activate the query, the program exits (with no exceptions > but a lot of heaptrc errors). > If I remove heaptrc the program works fine (and it doesn't appear to be > leaking memory, btw). > I see that zeos extensively uses interfaces, maybe is there some problem > using heaptrc with interfaces? I am also using refcounted interfaces and observed several leaks with 2.2.0, which disapeared a couple of weeks ago with branches_2_2. What is your fpc version?

It was a win32 lazarus snapshot from 2008-06-08 with fpc 2.2.3 (2.2.2 rc1 was just branched at the time, so I suppose it's pretty similar to 2.2.2rc1).
However what bothers me is not the memory leak (I think there is none) but the fact that the program terminates as soon as I activate the query.

Bye.

Luca Olivetti Wetron Automatizaci?n S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007

Reply by email

Vincent Snijders
to Luca Olivetti
Luca Olivetti wrote 20 lines
En/na Joao Morais ha escrit: > Luca Olivetti wrote: >> I was trying to detect memory leaks, so I activated the -gh (use >> heaptrc) option in compiler options. >> I left it activated and I added a zeos component (an sql query). >> As soon as I activate the query, the program exits (with no exceptions >> but a lot of heaptrc errors). >> If I remove heaptrc the program works fine (and it doesn't appear to be >> leaking memory, btw). >> I see that zeos extensively uses interfaces, maybe is there some problem >> using heaptrc with interfaces? > I am also using refcounted interfaces and observed several leaks with > 2.2.0, which disapeared a couple of weeks ago with branches_2_2. What is > your fpc version? It was a win32 lazarus snapshot from 2008-06-08 with fpc 2.2.3 (2.2.2 rc1 was just branched at the time, so I suppose it's pretty similar to 2.2.2rc1). However what bothers me is not the memory leak (I think there is none) but the fact that the program terminates as soon as I activate the query.

TBH, I think you found memory corruption in ZEOS.

Vincent

Reply by email

Martin Schreiber
to Luca Olivetti: En/na Joao Morais ha escrit: It was a win32 lazarus snapshot from 2008-06-08 with fpc…
Luca Olivetti wrote 11 lines
En/na Joao Morais ha escrit: > I am also using refcounted interfaces and observed several leaks with > 2.2.0, which disapeared a couple of weeks ago with branches_2_2. What is > your fpc version? It was a win32 lazarus snapshot from 2008-06-08 with fpc 2.2.3 (2.2.2 rc1 was just branched at the time, so I suppose it's pretty similar to 2.2.2rc1). However what bothers me is not the memory leak (I think there is none) but the fact that the program terminates as soon as I activate the query.

Possibly related to:
http://zeos.firmos.at/viewtopic.php?t=1729
?
In order to catch the heaptrace program abort compile FPC RTL with debug info and set breakpoints to all lines in heaptrc.pp where "halt" is called.

Martin

Reply by email

Luca Olivetti
to Vincent Snijders: TBH, I think you found memory corruption in ZEOS. Vincent

En/na Vincent Snijders ha escrit:

Show quoted text 22 lines
Luca Olivetti schreef: > En/na Joao Morais ha escrit: >> Luca Olivetti wrote: >>> I was trying to detect memory leaks, so I activated the -gh (use >>> heaptrc) option in compiler options. >>> I left it activated and I added a zeos component (an sql query). >>> As soon as I activate the query, the program exits (with no exceptions >>> but a lot of heaptrc errors). >>> If I remove heaptrc the program works fine (and it doesn't appear to be >>> leaking memory, btw). >>> I see that zeos extensively uses interfaces, maybe is there some problem >>> using heaptrc with interfaces? >> I am also using refcounted interfaces and observed several leaks with >> 2.2.0, which disapeared a couple of weeks ago with branches_2_2. What is >> your fpc version? > It was a win32 lazarus snapshot from 2008-06-08 with fpc 2.2.3 (2.2.2 > rc1 was just branched at the time, so I suppose it's pretty similar to > 2.2.2rc1). > However what bothers me is not the memory leak (I think there is none) > but the fact that the program terminates as soon as I activate the query. TBH, I think you found memory corruption in ZEOS.

It was actually a small memory leak. Thanks to your statement and Martin's advice (no, I didn't follow it ;-) ) I took a look at heaptrc.pp and I saw that it halts the program when a fault occurs in freemem (and zeos uses freemem) and I could redirect the output to a file (the dialog box in the lazarus application truncated the result, so it wasn't too helpful), see where the leak happened and fix it. Tomorrow I'll see if it's been already fixed in zeos svn and if not I will report a bug there.
Thanks again to both of you.

Bye

Luca Olivetti Wetron Automatizaci?n S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007

Reply by email