Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!samsung!zaphod.mps.ohio-state.edu!swrinde!emory!mephisto!mcnc!rti!mozart!sasdjb From: sasdjb@unx.sas.com (David Biesack) Newsgroups: comp.sys.apollo Subject: Re: GCC bug? Message-ID: <1990Sep14.205250.22057@unx.sas.com> Date: 14 Sep 90 20:52:50 GMT References: <1990Sep10.151351.20186@water.waterloo.edu> <1990Sep11.125319.21412@ncsuvx.ncsu.edu> Organization: SAS Institute Inc. Lines: 36 In article <1990Sep11.125319.21412@ncsuvx.ncsu.edu> jwb@cepmax.ncsu.edu writes: > I'm using gcc version 1.37.1 (with John Vasta's patches) to compile > the following program on a DN4500 (SR10.2, BSD4.3): > 1 main() > 2 { > 3 char x[10]; > 4 long i; > 5 > 6 for (i = 0; i <= 10; i++) x[i] = 'a'; > 7 > 8 return 0; > 9 } > Upon executing the program I get: > % a.out > unable to unwind stack because of invalid stack frame (process > manager/process fault manager) I suspect the fact that you are storing too many characters into x is causing the crash. (The valid indices for x are 0 to 9, not 0 to 10 as your loop generates.) If you get the same crash with the loop coded as: for (i = 0; i < 10; i++) x[i] = 'a'; ^^^^^^ then I would worry.... I don't know all the ANSI C rules, but it would suprise me if it says you are allowed write beyond static arrays! > John Baugh > jwb@cepmax.ncsu.edu djb -- David J. Biesack SAS Institute, Inc. Object Programming Technology SAS Campus Drive sasdjb@dev.sas.com Cary, NC 27513-2414 rti!sas!sasdjb (919) 677-8000 ext. 7771