From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRDGW1::ESTHER!TA2" 15-AUG-1989 23:53
To:	MRGATE::"ARISIA::EVERHART"
Subj:	re: uucico floating overflow

Message-Id:  <8908160343.AA11846@crdgw1.ge.com>
Received: from uvaarpa.virginia.edu by DRYCAS.CLUB.CC.CMU.EDU; Tue, 15 Aug 89
 23:36 EDT
Received: from virginia.acc.Virginia.EDU by uvaarpa.virginia.edu id aa18596; 15
 Aug 89 23:36 EDT
Received: from esther by virginia.edu id aa07658; 15 Aug 89 23:35 EDT
Received: by acci.com (DECUS UUCP w/Smail); Tue, 15 Aug 89 23:27:28 EDT
Date: Tue, 15 Aug 89 23:27:28 EDT
From: Tom Allebrandi <ta2@acci.com>
Subject: re: uucico floating overflow
To: vmsnet@DRYCAS.CLUB.CC.CMU.EDU
X-Vms-Mail-To: INFO-VMSNET

glassmann@ccavax.camb.com says:
>I ran into a problem in UUCICO when then number of failures trying to connect 
>to a remote host becomes excessively high.  We got a floating point overflow in
>check_call_times() in call.c on the line:
>    if (St_nfails > 1)
>	    fail_interval = fail_interval *
>		 pow(FAILFACTOR, (double)(St_nfails-1));
>I noticed it when nfails got to 473, but it may have started happening at a 
>lower number.  I got around it by editing the STST file and changing the nf 
>entry.

This is a known problem, and a fix will appear in the patch kit. It will
look something like this:

#include	limits

    if (St_nfails > 1)
	    if (St_nfails >
/* Formula A */	((log((double)INT_MAX / fail_interval) / log(FAILFACTOR)) + 1))
		    fail_interval = MAXFAILINT*60;
	     else
		    fail_interval = fail_interval *
			 pow(FAILFACTOR, (double)(St_nfails-1));

IF YOU APPLY THIS FIX, DO NOT DELETE YOUR ORIGINAL SOURCE. The patch kit
will assume base kit sources, and will not function correctly on source
code that has been modified.

-----

Lenny was lucky that the problem didn't occur until nfails ~= 473. It
was around 200 here. 

However, at about 50 nfails (35ish here), the fail_interval calculation 
overflows a long int. After that, the computation is pretty much
garbage until you get enough failures racked up that the pow() overflows.

The fix computes the value for nfails that will cause the fail_interval
calculation to overflow a long int, and prevents it from happening. A
side effect is that the floating overflow is blocked for the same reason.

"formula a" is the fail_interval equation solved for nfails....

--- Tom

Tom Allebrandi  | Advanced Computer Consulting,Inc  |  Charlottesville, VA
804 977 4272    | VMS User's Network Working Group -- The DECUS UUCP people
---------- you should be able to find me somewhere in this mess -----------
Bix: ta2        | Internet: ta2@acci.com | Bitnet: ta2%esther@virginia.edu
DCS: ALLEBRANDI | DECUServe: ALLEBRANDI  | Pageswapper: US142404
                | UUCP: ta2@esther.uucp    (...!uunet!virginia!esther!ta2)



