AW: AW: AW: [fpc-devel] MemoryLeak with AS Operator

Helmut Hartl helmut.hartl at firmos.at
Mon Aug 14 13:06:42 CEST 2006


> 
> I'll look into the bug report the next days.
>

Hello Florian,

Thanks for fixing the first bug, but
i am afraid, that there exist other memory related problems in 
FPC 2.0.3 (fixes branch). Our applications are not memory stable.
(Related Bugs 7174, 7209)

I am in the moment not able to reproduce the problems in a 
small non ZEOS dependent app, but as the program is memory
stable with delphi and fpc 2.0.2 i think of an bug in fpc.

If memory is acquired through:

"Getmem(x,size)"
and Freed through
"Freemem(x,size)"

I have a leak because Getmem reserves occasionally
more mem as specified in size?

Is 
"Getmem(x,size)" Freemem(x) correct?

I tried to check the program with valgrind 3.2

But valgrind 3.2 brings weird errors (garbled strings), when
i compile with something above 2.0.2 stable. (Tested 2.0.3 and 2.11).
With 2.0.2 Valgrind output is ok - but the program also :-)

Is valgrind support broken or do
I have to do something beyond setting the valgrind compiler switch?

Any ideas ?

For the brave and interested I include the 
test project, Makefile & settings.

Required: Linux, i386, fpc 202 fpc 204, mysql 5

Steps:
1) svn co svn://firmos.at/zeos/trunk
2) make a link to it under /z 
   (/z -> /svnwork/zeos/trunk/)
3) unpack the demo
4) make a link from fos_fpc to testing fpc_version
   (fos_fpc -> /usr/local/lib/fpc/2.0.2/ppc386)
5) execute make zeos_memhole2
6) Change the Database,Host,User ... in the sourcecode
7) Change the table name in the SQL to some table in your database
8) start the program / you see the leak 
   (depending on fpc version)

Maybe some config files must be adjusted.

Greets,

helmut 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zeos_mtest.tar.bz2
Type: application/octet-stream
Size: 1620 bytes
Desc: zeos_mtest.tar.bz2
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20060814/cc43c55b/attachment.obj>


More information about the fpc-devel mailing list