Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!b.gp.cs.cmu.edu!ralf From: ralf@b.gp.cs.cmu.edu (Ralf Brown) Newsgroups: comp.sys.ibm.pc Subject: Re: Environment problems Keywords: environment Message-ID: <8371@pt.cs.cmu.edu> Date: 9 Mar 90 23:53:12 GMT References: <1990Mar7.073215.23815@agate.berkeley.edu> <16558@orstcs.CS.ORST.EDU> <25F5EB94.8142@maccs.dcss.mcmaster.ca> <1990Mar8.162123.4418@cec1.wustl.edu> <25F7EFC0.10904@maccs.dcss.mcmaster.ca> Organization: Carnegie-Mellon University, CS/RI Lines: 34 In article <25F7EFC0.10904@maccs.dcss.mcmaster.ca> cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) writes: }In article <1990Mar8.162123.4418@cec1.wustl.edu> jcb2647@cec1.wustl.edu (James Christopher Beard) writes: }$ [...] Another reason to either upgrade (to 4.01) or }$downgrade (to 3.1) from 3.2. (Others include the floating-point bug }$in 3.2 [...] } } What floating-point bug? DOS doesn't handle floating-point math. From the Turbo C 1.5 README file: DOS 3.2 has a bug in its handling of floating exceptions. When an exception occurs, the system allocates a local stack for the exception handler. Unfortunately, when a system stack gets allocated, it never gets deallocated. The default number of stacks is 8. After 9 floating point exceptions occur, the system hangs and a cold reboot is required. Typical exceptions are overflow and divide by zero. The stacks are not reclaimed when a program terminates, so a program which divides by zero once will crash the machine if run 9 times. To avoid this problem, you can either: 1. Not use DOS 3.2. 2. Obtain a patch from IBM or Microsoft which fixes the bug, and install it on your copy of DOS. 3. Not use a floating point coprocessor. 4. Disable the exception trapping in your Turbo C program. You can do this easily by calling the _clear87() library function. For example, -- {backbone}!cs.cmu.edu!ralf ARPA: RALF@CS.CMU.EDU FIDO: Ralf Brown 1:129/46 BITnet: RALF%CS.CMU.EDU@CMUCCVMA AT&Tnet: (412)268-3053 (school) FAX: ask DISCLAIMER? | _How_to_Prove_It_ by Dana Angluin 3. by vigorous handwaving: What's that?| Works well in a classroom or seminar setting.