[fpc-devel] SYSUTILS UTF8String Memory Bug

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Aug 12 11:06:58 CEST 2014

On 11 Aug 2014, at 15:58, mark diener wrote:

> I ran heaptrc AND Dr memory and there are definitely some issues.  I  
> posted
> a separate thread to focus on baseline Dr Memory errors for
> lazarus/freepascal
> One of my problems is the stack reported by the results.txt file  
> shows the
> same code point: rpzstring.pas:193.
> Any ideas on  how to improve the reported code location. I can  
> promise you
> that fpc_ansistr_setlength is not located in rpzstring.pas.  It's in  
> the
> RTL!!!

It shows the last code for which it has debug information. If you  
compile the RTL (and LCL) with -gw2 (and make sure your program uses  
those recompiled units), then you will get source code information for  
them too.

> Project compiled with CMEM, Dwarf2 (-gw2) and requested by Dr Memory  
> docs.

The issue you posted below is unlikely to be related to the crashing  
problems you have. It only talks about a *possible* leak. Memory leaks  
do not lead to crashes, unless you exhaust all available memory or  
address space (which is not the case here). Additionally, it is  
probably a false detection, possibly triggered by the fact that  
ansistrings point past the header of the allocated block (an  
ansistring consists of an, internal implementation-defined, header  
followed by the string data, and the ansistring points to the string  


More information about the fpc-devel mailing list