Re: Alpha gcc

Jim Nance (jlnance@avanticorp.com)
Mon, 2 Dec 1996 14:14:52 -0500 (EST)

> I was working on a program on an AXP using gcc, I defined a vector
> float dA[NMAX] and NMAX was defined in the header file. I inadvertantly
> ran the index of dA to NMAX + 1 . The program compiled and ran. I took
> the same program and placed it on an intel linux with gcc and I got the
> expected core dump. Why doesn't the above cause a core dump on the AXP? I
> know it is poor programming, but I am curious as to why it works one way
> on one machine but not on the other. Thanks.

You only get a core dump if you happen to access an address that is on a
page that is not mapped into your processes address space. On the intel
dA[NMAX] apparently ends at a page boundary. On the alpha it does not.
There are many reasons this could be true. One is that the alpha has 8K
pages while the intel has 4K pages (does NMAX happen to be 1024?). If you
overrun the address by enough, you will get a core dump.

Jim

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com



Feedback | Store | News | Support | Product Errata | About Us | Linux Info | Search | JumpWords
No Frames | Show Frames

Copyright © 1995-1997 Red Hat Software. Legal notices