I think I'm hitting this problem with egcs-2.91.66.
I'm porting Ingres to run on Alpha Linux and twice now, at different parts in the code I've had a SEGV similar to the one below which as been resolved by compiling with -O0. Not ideal for a database.

Has there been any further development with this issue?
Is there a fix?
Any help would be greatly appreciated.


Jeremy Hankinson
Ingres Dev - Linux
Computer Associates
Islandia, NY
e-mail: jeremy.hankinson@ca.com
tel: +1 631 342 5086


-----Original Message-----
From: Uncle George [mailto:gatgul@voicenet.com]
Sent: Wednesday, October 04, 2000 5:45 PM
To: axp-list@redhat.com; Michal Jaegermann
Subject: Re: who is responsible for egcs/gcc on alpha nowadays


Ok, now got a simple sample. it seems that using -O2 causes the frame pointer
to be off.
compile with
gcc -O2 -g   tstparm.c tstparm2.c

using "gdb a.out"  u can either step trace  ( display/i $pc  & then si ), or
just "r" and  show the back trace
a -02 build has this back trace. the variable lineAddr should have
0x1000000007 in it

===========================================================
$ gdb a.out
GNU gdb 19991004
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.

Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "alpha-redhat-linux"...
(gdb) r
Starting program: /gat/alinux-java/build/solaris/a.out

Program received signal SIGSEGV, Segmentation fault.
foo_4ch_bl (leftEdges=0x1000000001, rightEdges=0x1000000002,
    xStarts=0x1000000003, yStarts=0x1000000004, sides=0x1000000005,
    dstData=0x200003a5408 " h\025", lineAddr=0x200003aaa48, dstYStride=1,
    srcYStride=1299556) at /tmp/tstparm2.c:35
35  foo_s32  yFinish = sides[1];
(gdb) where
#0  foo_4ch_bl (leftEdges=0x1000000001, rightEdges=0x1000000002,
    xStarts=0x1000000003, yStarts=0x1000000004, sides=0x1000000005,
    dstData=0x200003a5408 " h\025", lineAddr=0x200003aaa48, dstYStride=1,
    srcYStride=1299556) at /tmp/tstparm2.c:35
#1  0x12000044c in main () at /tmp/tstparm.c:37

=====================================================================
and gcc  -O1 -g produces this
======================================================================

gdb a.out
GNU gdb 19991004
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.

Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "alpha-redhat-linux"...
(gdb) r
Starting program: /gat/alinux-java/build/solaris/a.out

Program received signal SIGSEGV, Segmentation fault.
foo_4ch_bl (leftEdges=0x1000000001, rightEdges=0x1000000002,
    xStarts=0x1000000003, yStarts=0x1000000004, sides=0x1000000005,
    dstData=0x1000000006 <Address 0x1000000006 out of bounds>,
    lineAddr=0x1000000007, dstYStride=268435464, srcYStride=268435465)
    at /tmp/tstparm2.c:35
35  foo_s32  yFinish = sides[1];


Michal Jaegermann wrote:

> Uncle George wrote:
> >
> > It seems like the egcs compiler in redhat/6.2 is producing bad stack
> > addressing. In my case it appears to be off by 16 bytes, and fetches the
> > 7th arg from the wrong place( short by 16 bytes in fact ).
>
> I, for one, would be really interested in seeing a sample code which
> would demonstrate that.  I have seen in the past wrong offsets but they
> were results of bugs in sources.