delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/10/14:48:18

Date: Thu, 10 Feb 2000 18:09:36 GMT
From: Peter Restall <pete AT restall DOT net>
Message-Id: <200002101809.SAA01894@burdock.restall.net>
To: djgpp AT delorie DOT com
Subject: SIGFPE
Reply-To: djgpp AT delorie DOT com

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

It was before control was passed to my code -- I didn't even get to print
any of my initialization text on the screen.

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).  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.  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).
My snippet of offending code looks like:

	/* Calculate the first (u,v) position for the starting X
	   coordinate */

	if (c != 0.0)
	{
		temp  = 1.0 / c;
		u_end = (a * temp) * txt_buf->f_width;
		v_end = (b * temp) * txt_buf->f_height;
	}
	else
	{
		u_end = 0;
		v_end = 0;
	}

There is another similar bit of code further down, with the same 'c != 0.0'
check accompanying it.  Oh, and perhaps I should mention that I'm running a
Linux to DOS/DJGPP cross compiler.  Has anyone any suggestions, please ?  Any
help will be appreciated.  Thanks,

	Pete =:-)


--
/*************** [burdock] ****************/
/*   .~.                                  */
/*   /V\    pete AT restall DOT net              */
/*  // \\   http://www.restall.net/petes/ */
/* /(   )\  ICQ 49155531                  */
/*  ^`~'^                                 */
/******************************************/

/******************************* [Windoze 98] ********************************/
/* Windows 98: n.                                        (Alex Satrapa).     */
/*   64 bits (and pieces) of bugs (and fixes) and featuritis tacked on to 32 */
/*   bit extensions and a graphical shell for a 16 bit patch to an 8 bit     */
/*   operating system originally coded for a 4 bit microprocessor, written   */
/*   by a 2 bit company that can't stand 1 bit of competition, and has not a */
/*   bit of respect for their customers.                                     */
/*****************************************************************************/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019