Date: Sat, 24 Nov 2001 09:53:43 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: "Graham Rangel-Sharp" Message-Id: <9003-Sat24Nov2001095342+0200-eliz@is.elta.co.il> X-Mailer: emacs 21.1.50 (via feedmail 8 I) and Blat ver 1.8.9 CC: djgpp AT delorie DOT com In-reply-to: (een7gdr@leeds.ac.uk) Subject: Re: Win2000 DJGPP Problem Report Calculations still there References: Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Newsgroups: comp.os.msdos.djgpp > From: "Graham Rangel-Sharp" > Date: Fri, 23 Nov 2001 10:50:50 GMT > > I tried including the following lines: > > #include - into the top of main.c > int _crt0_startup_flags = _CRT0_FLAG_FILL_SBRK_MEMORY; - at the top of > main() That is the correct usage. > However the problem still persists. One other suggestion would be to turn on the numeric exceptions and see where does the program abort with SIGFPE. To this end, make this line be the first executable statement of your `main' function: _control87 (0x0332, 0xffff); (you will need to include the header). This will cause your program to crash instead of producing NaNs. Compile and link the modified program with the -g switch, then, when it crashes, use the SYMIFY utility to translate the crash message into a human-readable backtrace of function calls. That will tell you where in the code does the first NaN or Inf happens. You can then look around near that place and try to figure out what goes wrong with that computation, or use printf to print values of suspicious variables. Section 9.3 of the DJGPP FAQ list tells more about using SYMIFY, and section 12.2 tells more about the information printed in the crash message. > I did try using the Cygwin port of the > utilities but the software crashes very early on saying "segmentation fault, > core dumped." Something is seriously ill in this program... > this appears to happen at the line: > > Calc_elec_jacobian(&F2v,&F2n,F2p); > > However F2v, F2n and F2p all seem to be valid variables. It seems like the > computer is trying to reference memory at an address that is not available. Are you sure that the crash is in the code that calls Calc_elec_jacobian, not inside Calc_elec_jacobian? > I tried to add the above lines to the cygwin version of the software but > crt0.h doesnt exsist on my Cygwin version. That's right, the _crt0_startup_flags variable is DJGPP-specific.