[fpc-devel] FPC 2.2.2 on Linux/SPARC

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Sep 3 23:23:27 CEST 2008


On 03 Sep 2008, at 17:05, Mark Morgan Lloyd wrote:

> Program received signal SIGBUS, Bus error.
> 0x00011fc4 in FILLCHAR (X=void, COUNT=18, VALUE=546774876) at  
> generic.inc:143
> 143     generic.inc: No such file or directory.
>        in generic.inc
> (gdb) backtrace
> #0  0x00011fc4 in FILLCHAR (X=void, COUNT=18, VALUE=546774876) at  
> generic.inc:143
> #1  0x00011e18 in FILLCHAR (X=void, COUNT=19, VALUE=32 ' ') at  
> system.inc:178
> #2  0x0001a7c8 in SPACE (B=318767107, result=' 0,${'#2#2#2#2'}, 
> 0'#0#0#0#0#0#0) at sstrings.inc:353
> #3  0x0001b93c in STR_REAL (LEN=22, F=-1, D=nan(0xfffffffffffff),  
> REAL_TYPE=RT_S64REAL, S='i1', highS=255)
>    at real2str.inc:456
> #4  0x0001be90 in fpc_shortstr_float (D=nan(0xfffffffffffff),  
> LEN=-32767, FR=-1, RT=1, S='i1', highS=255)
>    at sstrings.inc:403
> #5  0x00215d58 in TDEBUGINFOSTABS__APPENDSYM_CONST (LIST=0xf7854df0,  
> SYM=0xf7a55210, this=0xf7f944a0)
>    at dbgstabs.pas:1343
> #6  0x0011bd78 in TDEBUGINFO__APPENDSYM (LIST=0xf7854df0,  
> SYM=0xf7a55210, this=0xf7f944a0) at dbgbase.pas:358
> #7  0x0011c39c in TDEBUGINFO__WRITE_SYMTABLE_SYMS (LIST=0xf7854df0,  
> ST=0xf7f7c490, this=0xf7f944a0)
>    at dbgbase.pas:428
> #8  0x00216318 in TDEBUGINFOSTABS__INSERTTYPEINFO (this=0xf7f944a0)  
> at dbgstabs.pas:1415
> #9  0x001977e8 in PROC_UNIT () at pmodules.pas:1129
> #10 0x0016ebd0 in COMPILE (FILENAME='../objpas/math.pp') at  
> parser.pas:373
> #11 0x0004704c in COMPILE (CMD='') at compiler.pas:244
> #12 0x000103cc in main () at pp.pas:207
> (gdb)
>
> Hope I got that right.

Yes, you did. Thanks. The bug is indeed in fillchar in generic.inc:

       { Align on native pointer size }
       aligncount:=(PtrUInt(pdest) and (sizeof(PtrUInt)-1));
       dec(count,aligncount);
       pend:=pdest+aligncount;

That make aligncount equal to the misalign count, rather than to the  
number of bytes necessary to align the pointer. It should rather be  
something like this:

       pend:=align(pdest,sizeof(ptruint));
       dec(count,pend-pdest);

I'll look at it tomorrow.


Jonas



More information about the fpc-devel mailing list