[fpc-pascal] heap problem or fpc_ansistr_decr_ref in FPC for ARM

josepascual josepascual at almudi.com
Thu Jun 21 12:22:00 CEST 2007

Hi Everyone, (gdb) list
I have made FPC (fpc-2.1.4_aka_2.2.0_beta) for ARM with DEBUG=1 so I can
debug problem:

I have a program which works okey in same version for i386 but for arm
I'm trying to debug it to see what it's happening

I have run program in GDB and I received it:

Program received signal SIGSEGV, Segmentation fault.
TRY_CONCAT_FREE_CHUNK_FORWARD (MC=0x40213170) at heap.inc:679
679     in heap.inc

and Backtrace is:

(gdb) print MC
$17 = (PMEMCHUNK_VAR) 0x40213170
(gdb) print MC_TMP
$18 = (PMEMCHUNK_VAR) 0x0
(gdb) print SIZEMAK
No symbol "SIZEMAK" in current context.
(gdb) print SIZEMASK
$19 = -16
$20 = 690513264
(gdb) bt
#0  TRY_CONCAT_FREE_CHUNK_FORWARD (MC=0x40213170) at heap.inc:678
#1  0x0002a574 in TRY_CONCAT_FREE_CHUNK (MC=0x40213170) at heap.inc:691
#2  0x0002acc0 in SYSFREEMEM_VAR (PMCV=0x40213170) at heap.inc:1040
#3  0x0002ad0c in SYSFREEMEM (P=0x40213170) at heap.inc:1059
#4  0x00029ad8 in FREEMEM (P=0x40213178) at heap.inc:342
#5  0x0001cd0c in fpc_ansistr_decr_ref (S=0x40213178) at astrings.inc:107
#6  0x00077ee8 in LUAPUSHVARIANT (L=0xdda08, N=void) at LuaUtils.pas:464
#7  0x00069a10 in LUACOPYTABLE (L=0xdda08, IDXFROM=4, IDXTO=2, MTTO=3)
    at lua_WrapUp.pas:51
#8  0x00069dd8 in NEW_TMYTYPE (L=0xdda08) at lua_WrapUp.pas:125
#9  0x000961bc in luaD_precall ()
#10 0x0009f084 in luaV_execute ()
#11 0x00000000 in ?? ()

mc^size of 690513264 is not very regular, is it?
What size is normal for it?

Any Idea?

How Can I patch it?

thank you for your help

Jose Pascual

More information about the fpc-pascal mailing list