From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,a191e211a3e9da1d X-Google-Attributes: gid111c93,public X-Google-ArrivalTime: 2001-06-29 09:54:22 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!feed.textport.net!sn-xit-04!sn-post-01!supernews.com!corp.supernews.com!rob From: rob@GTEDHCP-183.inetarena.com (Robert M. Riches Jr.) Newsgroups: comp.os.linux.alpha Subject: Re: 13 line c program segfaults on alpha/linux, but not intel. why? Date: Fri, 29 Jun 2001 16:51:39 -0000 Organization: none-at-all Message-ID: References: <2M1%6.147007$Bz6.91285@sjc-read.news.verio.net> Reply-To: richesr1@inetarena.com User-Agent: slrn/0.9.6.4 (Linux) X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.os.linux.alpha:3206 On Fri, 29 Jun 2001 16:10:38 GMT, Patrick Paul wrote: >a little help from those programmer types out there. i compared >/proc/sys/kernel entries between intel and alpha machines, and that wasn't >the problem. > >what happens is that i compile this proggy > >#include >#define SIZE 1047977 > >main () >{ > double vector_x [SIZE]; > int x; > > for ( x = 0; x < SIZE; x++ ) > vector_x [x] = (double) x; > > printf ("\n x [%d] = %.4f\n\n", SIZE - 1, vector_x [SIZE - 1] ); >} > > >which compiles fine > >but when i run it on alpha, it coredumps and segfaults. > >on intel, it works fine. It's not too hard to stump me, as I'm far from an expert, but this dumps core on my RH7.0 Alpha Linux box, too. My first thought was that there should probably be an 'l' in front of the 'f' in the format string. I tried all four combinations of 'l' vs. no 'l' in front of the 'd' and 'f'. All four core dump. A check with gdb says the problem happens in the printf call, at line 270 of vfprintf.c, and at line 203 of dl-runtime.c, at their respective levels on the stack. I don't find either of these files on my system, so I would guess they are in the GLIBC sources. Good luck. Robert Riches richesr1@inetarena.com