[fpc-devel] Heaptrace + cwstring cause SIGSEGV at the end

Petr Kristan petr.kristan at epos.cz
Mon Mar 10 16:13:19 CET 2014


Hi.

I use heaptrc and cwstring units in Linux.
If memoryleak occurs and program ends, then i get SIGSEGV in cwstring.pp:481 (iconv call)
because cwstring unit is finalized before heaptrc.

#1 iconv(<optimized out>, 0x7fffffffd738, 0x7fffffffd760, 0x7fffffffd730, 0x7fffffffd748) at iconv.c:53
#2 ANSI2WIDEMOVE(0x7fffef7cf038 '/home/petr/obis4/bin/obis-linux', 65001, 0x7fffee687dd8 '', 31) at ../unix/cwstring.pp:481
#3 fpc_ansistr_to_widechararray(0x7fffffffd830 #43472#63484#32767, 255, 0x7fffef7cf038 '/home/petr/obis4/bin/obis-linux') at ../inc/ustrings.inc:820
#4 ASSIGN({}, 0x7fffef7cf038 '/home/petr/obis4/bin/obis-linux') at ../inc/file.inc:58
#5 ASSIGN({}, '/home/petr/obis4/bin/obis-linux') at ../inc/file.inc:71
#6 OPENEXEFILE({F = {}, SIZE = 0, ISOPEN = false, NSECTS = 0, SECHDROFS = 0, SECSTROFS = 0, PROCESSADDRESS = 0, FUNCTIONRELATIVE = false, IMGOFFSET = 0, FILENAME = ...
#7 OPENDWARF(0x4633a2) at ../inc/lnfodwrf.pp:152
#8 GETLINEINFO(4600738, '', '', 0) at ../inc/lnfodwrf.pp:734
#9 DWARFBACKTRACESTR(0x4633a2) at ../inc/lnfodwrf.pp:767
#10 CALL_STACK(0x7fffeea43d00, {}) at ../inc/heaptrc.pp:307
#11 DUMPHEAP at ../inc/heaptrc.pp:1233
#12 TRACEEXIT at ../inc/heaptrc.pp:1486
#13 HEAPTRC_$$_finalize at :1615
#14 FINALIZEUNITS at ../inc/system.inc:907
#15 INTERNALEXIT at ../inc/system.inc:960
#16 DO_EXIT at ../inc/system.inc:1024
#17 main at obis.lpr:63


Heaptrace is switched on by -gl fpc option.

obis.lpr:
uses
  cthreads, cwstring
...

fpc 2.7.1 and lazarus 1.3

Exists some solution for this problem?

Thanks
Petr

-- 
Petr Kristan
.
EPOS PRO s.r.o., Smilova 333, 530 02 Pardubice
tel: +420 461101401    Czech Republic (Eastern Europe)
fax: +420 461101481



More information about the fpc-devel mailing list