[Lazarus] Shared libraries, cmem and heaptrc

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Jun 8 14:03:29 CEST 2012


On Fri, 08 Jun 2012 09:15:46 +0000
Mark Morgan Lloyd <markMLl.lazarus at telemetry.co.uk> wrote:

> Before cautiously tackling a shared library, I thought I'd have a trial 
> run with cmem in the program that's going to call it. I find that if I 
> put 'cmem, heaptrc' at the start of the .lpr it runs and I get heaptrc 
> output, /but/ one of the files has a wildly erroneous error number.
> 
> If I remove both cmem and heaptrc from the .lpr  I still get the error, 
> despite having carefully removed all binaries etc. Is there a cache 
> somewhere that also needs to be cleared?

AFAIK cmem and heaptrc only change the program and not any other unit
ppu/o.

But you can use Run / Clean up build files to make sure.

How do you share the shared units between library and program?

 
> Call trace for block $B64BB780 size 33
>    $08074E2A  REALLOCMEM,  line 317 of 
> /usr/local/src/fpc/fpcbuild-2.6.0/fpcsrc/rtl/inc/heap.inc
>    $08068830  fpc_ansistr_setlength,  line 588 of 
> /usr/local/src/fpc/fpcbuild-2.6.0/fpcsrc/rtl/inc/astrings.inc
>    $080681AC  fpc_ansistr_concat,  line 225 of 
> /usr/local/src/fpc/fpcbuild-2.6.0/fpcsrc/rtl/inc/astrings.inc
>    $080D58D5  FORMAT,  line 369 of 
> /usr/local/src/fpc/fpcbuild-2.6.0/fpcsrc/rtl/objpas/sysutils/sysformt.inc
>    $080D5F16  FORMAT,  line 930 of 
> /usr/local/src/fpc/fpcbuild-2.6.0/fpcsrc/rtl/objpas/sysutils/sysstr.inc
>    $0809ED76  ALSAMIDIAVAILABLE,  line 1741 of alsamidi.pas *****
>    $0809DD50  TUNYOKEDFRONTENDFORM__ONAFTERSHOW,  line 790 of 
> unyokedfrontendcode.pas
>    $08095776  TAPPLICATION__PROCESSASYNCCALLQUEUE,  line 1087 of 
> ./include/application.inc
> 0 1>markMLl at pye-dev-13:/usr/local/src/unyoked/trunk/frontend$
> 
> ***** This file only has 925 lines, I removed stuff that wasn't needed 
> yesterday. It contains no conditional compilation or includes, it does 
> though have some nested functions.
> 


Mattias




More information about the Lazarus mailing list