From: Eli Zaretskii Newsgroups: comp.os.msdos.djgpp Subject: Re: SIGFPE Date: Sat, 12 Feb 2000 14:52:40 +0200 Organization: NetVision Israel Lines: 58 Message-ID: <38A55798.A8B549D3@is.elta.co.il> References: <200002101809 DOT SAA01894 AT burdock DOT restall DOT net> NNTP-Posting-Host: ras1-p79.rvt.netvision.net.il Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.netvision.net.il 950359993 21805 62.0.172.81 (12 Feb 2000 12:53:13 GMT) X-Complaints-To: abuse AT netvision DOT net DOT il NNTP-Posting-Date: 12 Feb 2000 12:53:13 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en,ru,hebrew To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Peter Restall wrote: > > Hi everyone. I've just tried to run my program and it crashed with the > following information (I also ran 'symify' on it). > > C:\WINDOWS\TEMP>6dof > Exiting due to signal SIGFPE > Floating Point exception at eip=0000e7f2 > eax=00000000 ebx=00000000 ecx=00000043 edx=00062033 esi=0005fc64 edi=0001fea0 > ebp=0005fe80 esp=0005fc64 program=C:\WINDOWS\TEMP\6DOF.EXE > cs: sel=00a7 base=826d7000 limit=0006ffff > ds: sel=00af base=826d7000 limit=0006ffff > es: sel=00af base=826d7000 limit=0006ffff > fs: sel=0087 base=00013f00 limit=0000ffff > gs: sel=00c7 base=00000000 limit=ffffffff > ss: sel=00af base=826d7000 limit=0006ffff > > Call frame traceback EIPs: > 0x0000e7f2 __detect_80387+6 > 0x0000cc71 ___crt1_startup+105 Seems like you are still using DJGPP v2.01. Please upgrade to v2.03 and see if this problem is still there. V2.01 is very old and not supported anymore (I don't even have a v2.01 installation anymore to try looking into this). > Lately, I've been having problems running my program (a 3D engine) when > compiled with DJGPP (under Linux, the engine runs fine), as it complains of > SIGFPEs quite a lot (*usually* after my prograqm has been running for a little > while). That could be an entirely different problem. The above crash is in the startup code, not in the application code. One thing I'd suggest to look at is your stack usage. If your programs declare some very large automatic arrays or data structures, they will overflow the run-time stack, and that could indeed cause all kinds of weird crashes. > I've inspected my code where 'symify' points me to, but I've got > checks in place to detect a divide-by-zero and avoid it. SIGFPE is not only for divide-by-zero errors, it also happens in many other situations. > I have no idea why > my checks seem to be ignored (also, I've set up a signal-handler that should > be called whenever I get a SIGFPE, but it hasn't been called once so far). If the crashes are in the startup code, like the one you posted, then your signal handlers are not yet established. > Oh, and perhaps I should mention that I'm running a > Linux to DOS/DJGPP cross compiler. What version of GCC do you use for the cross-compilation? Also, if you can compile natively on DOS/Windows, please do and see if the problem persists.