I just tried the new gpc 20051116 based on gcc 3.4.4 and the gpc testsuite shows no more problems with sets. As you suggested, it was probably due to a bad build of my Solaris GPC 2050331.
Please consider this issue as closed.
Regards
Pascal Viandier pascal@accovia.com
-----Message d'origine----- De : gpc-owner@gnu.de [mailto:gpc-owner@gnu.de] De la part de Waldek Hebisch Envoyé : December 8, 2005 23:56 À : gpc@gnu.de Objet : Re: RE : RE : Crash with sets under Solaris
Pascal Viandier wrote:
That may be the difference. IIRC I used Gnu assembler and linker (and I have different versions of Sun tools).
If I remember well, the instructions to build gpc say to avoid GNU
assembler
and linker under Solaris. That's why I did not use them.
For some reason you gpc installation works differently then other, I just trying to find a possible cause.
The test program:
<snip> > > Program received signal SIGSEGV, Segmentation fault. > > $00029134 in _p_Set_Equal (Seta=$55d84, Lowa=0, Higha=1312,
Setb=$41c62,
Lowb=3, Highb=0)
That shows paramteters at the point of crash (where they changed by
the
execution). Can you put a breakpoint at _p_Set_Equal and check if parameters are correct: both Seta nad Setb should point to number 40.
A bit far from 40: (gdb) p *(long *) Seta $4 = 83886080 (gdb) p *(long *) Setb $3 = 1280
If the paramters are incorrect then one should egzamine assembly file obtained via `gpc -g -S adam3k2.pas'.
Here it is:
.local S .common S,2,1 .section ".data" .type S2, #object .size S2, 2
^^^ wrong size
S2: .asciz "\024"
^^^^^^ Looks unaligned
.section ".rodata" .LLC0: .asciz "\024" .LLC1: .ascii "\005" .align 8
.stabs "S:S(0,77)=@s16;S(0,78)=r(0,1);0000000000001;0000000000012;",40,0,6,S .stabs "S2:S(0,79)=@s16;S(0,80)=r(0,1);0000000000001;0000000000012;",38,0,7,S2
^^^ Again wrong size.
This output explains test failures and crashes: your gpc thinks that the sets above take 16 bits, but gpc runtime expects 32 bits. Cross compiler gives me the correct size.
ATM it is still not clear why your gpc uses wrong size for sets, but one possible explanation is quite simple: gcc contains code which allocates to each set a sequence of bytes. Gpc patches backend files to use a sequence of words for a file. So your output would be expected if some of backend files are used unpatched.
However, the file I got from the cross compiler looks OK, so the most likely reason is assembler or linker.
Should I try GNU ones?
It looks that your gpc was built incorrectly. With the new info there is no reason to specifically suspect assembler or linker.
I think that you should first re-build gpc from scratch: unpack the sources, configure and make. It may be wise to use 20051116 version as it already contains patches needed by Solaris.
If the problem persist after re-build one should the examine messages appearing during build. Normally messages go to screen and vanish, but there are many ways to capture them. For example, I typically write:
make bootstrap > mlogg 2>&1
-- Waldek Hebisch hebisch@math.uni.wroc.pl