Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!mcvax!inria!gouldfr!cetia!rob From: rob@cetia.UUCP (Rob Gordon) Newsgroups: comp.windows.x Subject: SIGFPE in miFillSppPoly() Keywords: unitialized variables Message-ID: <941@cetia.UUCP> Date: 22 Jun 89 14:11:22 GMT Organization: Cetia, Toulon, France Lines: 30 i'm posting this on the news because the mail i sent to xpert has bounced several times, so i'm not sure if it got through. the mail concerned what appears to be a problem of unitialized variables in miFillSppPoly() (server/ddx/mi/mifpolycon.c). the problem arises on our system because the Green Hills cc is pretty clever about making use of the FPU, but if an FPU register has not been initialized previously then it contains a Not-a-Number value. Subsequent use of this value (ie using the unitialized variable that is held in the FPU register) results in a SIGFPU in ceil(). there are paths through miFillSppPoly() which could mean (unless precluded by the algorithm, but i haven't checked this) that the double variables ml, mr, xl, and xr can be used without being initialized, which is what appears to be catching me. i've added a line at the top of the function to initialize all four to 0.0, which i hope is a reasonable value. i'm pretty certain this is a systemV specific bug, because the BSD maths library does something sensible with NaN values whereas the sysV libraries generate SIGFPE. cheers rob -- Rob Gordon rob@inset.co.uk ...!mcvax!ukc!inset!rob