[fpc-devel] problem with TStringLists and delete in glibc

Stefan Fischer sfischer at basis.biz
Fri Mar 15 21:19:48 CET 2013


Hi,
 
I've get the following error and I don't know how to solve it:
*** glibc detected *** ./rfm: free(): invalid pointer: 0xb6d0a01c ***
 
code-pieces:
##############################################
type 
T_IniFileDesc = record
     inifilbuf : TStringList;
     caching,
     blockchange,
     inifildirty,
     inifilavail : boolean;
     inifilename : string;
  end; 
 
var IniFileDescriptor:T_IniFileDesc; name_idx:longint;
...
 
with IniFileDescriptor do
begin
  inifilbuf:=TStringList.create;
  for name_idx:= 1 to 220 inifilbuf.add('something');
  name_idx:=5;
  inifilbuf.insert (name_idx-1, 'someOTHERstring');       
  inifilbuf.delete(name_idx);  // <- this creates the glibc error 
end;
##############################################
 
I'm runnig fpc on:
Free Pascal Compiler version 2.6.0-7+rpi1 [2013/01/23] for arm
Copyright (c) 1993-2011 by Florian Klaempfl and others
Target OS: Linux for ARMHF

uname -a gives: Linux raspberrypi 3.6.11+ #393 PREEMPT Fri Mar 8
16:36:28 GMT 2013 armv6l GNU/Linux

 
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20130315/7a2536e7/attachment.html>


More information about the fpc-devel mailing list