From: Damian Yerrick Newsgroups: comp.os.msdos.djgpp Subject: Re: SIGSEGV problem (disaster!) Organization: Pin Eight Software http://pineight.8m.com/ Message-ID: References: <8o64nq$s1q$1 AT nnrp1 DOT deja DOT com> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 63 X-Trace: +LkLmhwhK5hK/eiKNTwogfkt/rNVWa/7y8a422smVs2GDhbqq6sZw4j54DL3hYMfhVEUeJ5n17nu!Czn8iXAYuMn8pasO2s8Q2qQih56xa8iqL/G3rZujm5vsD7M/pdK8Fi7Q563B2MayDvH+qE7yO7Dh!MTC8 X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Fri, 25 Aug 2000 16:13:02 GMT Distribution: world Date: Fri, 25 Aug 2000 16:13:03 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Fri, 25 Aug 2000 15:52:36 GMT, jcditz AT my-deja DOT com wrote: >I am currently writing a program for my senior >Optical Physics research at svsu. Anyhow, I've >got the program written (DJGPP of course), and it >sure seems correct. At least, it compiles with no >errors/warnings. The problem is, when I try to >run it, it dumps a huge long nasty message: >Exiting Due to signal SIGSEGV. >stack fault at eip=000015d1 >and all the other stuff (values of the registers >at the time and everything. Right after it crashes, in the same DOS session, try running symify foo.exe You'll get better results from symify if you specify the -g switch (basic debugging information) to symify. >I don't have an awful lot of experience >programming in C, so I'm not sure what is wrong >(at least the syntax is right). SIGSEGV is most likely a general protection fault or something similar. >Using Turbo C++ 3.0 I get "stack overflow" >messages when I try to run it. In Borland C++ >5.02 for Windows I get a "This program has >performed an illegal operation and will be shut >down" message which says it caused a "stack >fault". How much recursion are you using? Try optimizing tail-recursion into goto's. (This is one of the rare "good uses" of goto, to hand-optimize tail-recursion.) >The only thing I should point out is that I'm using >some really big arrays. >I use about half a dozen doubles which are [61] >[61][3] Each of those is about 87 KB. DJGPP's stack (used for automatic variables and return addresses) is 512 KB by default; search the FAQ list to find out how to change it. >as well as one huge one >int array [1281][1281]; This array is over 6 MB in size! >Originally I was using Turbo C++ but when I got >the error I figured it was just too much for a 16- >bit compiler. Is it too much for a 32-bit >compiler too? Not if you dynamically allocate space for the array with malloc(). -- tiddly-day interj. (used to express agreement.) [American cellphone lingo] This is McAfee VirusScan. Add these two lines to your signature to prevent the spread of signature viruses. http://www.mcafee.com/