From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 10-MAR-1990 08:49
To:	MRGATE::"ARISIA::EVERHART"
Subj:	re: need HELP with looping ... also MAIL PATCH

Message-Id:  <9001101216.AA14621@crdgw1.ge.com>
Received: From CUNYVM.CUNY.EDU by CRVAX.SRI.COM with TCP; Wed, 10 JAN 90 03:48:40 PDT
Received: from DGOGWDG5.BITNET by CUNYVM.CUNY.EDU (IBM VM SMTP R1.2.2MX) with BSMTP id 0280; Wed, 10 Jan 90 06:18:34 EDT
Date:    Wed, 10 Jan 1990 12:15:22  +0100
From: "GWDGV1::MOELLER"  <U0012%DGOGWDG5.BITNET@CUNYVM.CUNY.EDU>
To: info-vax@sri.COM
Subject: re: need HELP with looping ... also MAIL PATCH

Yesterday, I wrote:
>> Lately, I notice almost every day some interactive process
>> looping and happily spending CPU time in an apparently tight loop.
>>
>> The processes usually run MAIL.EXE (quite frequently used at our site),
>> ...
>> This is VMS 5.1-1 (to which we converted only 4 weeks ago),

Three helpful replies (by madison@vms.ecs.rpi.edu (Matt Madison),
gt3237c@prism.gatech.edu (Sieweke, Michael A), and "Bruce A. Hudson"
<hudson@ug.cs.dal.ca>) pointed to the 5.0/5.1 bug in MAIL.EXE.
Thanks a lot!
To quote Bruce Hudson,

> [...] This problem is one of the major pains around our
> site these days. It is a bug in MAIL. The problem is caused by entering an
> address with unmatched quotation marks. It causes mail to enter a tight
> loop. All to often, a user encountering this situation will disconnect the
> terminal rather than type a control-Y. Then MAIL happily runs [...],
> using up as much of the CPU as it can get. [...]
>    There does not seem to be anything you can do except point out the bug
> to your users and ask them to control-Y if they make the mistake of leaving
> off a quote. [...]

In the meantime, I obtained some evidence that this had been the case at our
site, too. (Actually, I knew about this bug - reported on INFO-VAX long ago -
but somehow never realized it could hurt us.)

So, why not do something about it ...
I think the following patch to MAIL.EXE fixes this loop -
won't give an error message as in VMS 5.2, where it's corrected,
but makes MAIL ignore a badly formed address.

--------------- cut here -----------------------------------
MAIL.EXE
!
! fix infinite loop in MAIL on unbalanced quotes in address
! w.j.m. 10-jan-1989
!
! applies to: VMS 5.1, VMS 5.1-1
!       (problem also exists in VMS 5.0; corrected in VMS 5.2)
!
! module MAILPARSE.B32 fiche 330
!
!
define _lib$state$  = 12d8e
define fix100$state = _lib$state$ + 20
!
check not eco 1:128     ! VMS 5.1-1 MAIL.EXE has no ECOs set
set eco 100             ! user ECO
!
set mode word
!
verify fix100$state     ! 2nd (unnamed) state (1st is labelled "next_address")
05F6
099F8   ! ((get_address),next_address,address_action)
000A
70B8
0FFFF
0FFD4
15F6    ! (TPA$_LAMBDA,next_address) - this will loop on bad syntax
0FFD0
exit
!
replace fix100$state + 0E = 0FFD0
0FFFE   ! convert to (TPA$_LAMBDA,TPA$_FAIL)
exit
!
update
exit
--------------- cut here -----------------------------------
[Never patched a TPARSE state table before ... real fun!]

Enjoy,
        -wjm

Wolfgang J. Moeller, GWDG, D-3400 Goettingen, F.R.Germany | Disclaimer ...
Bitnet/Earn: U0012@DGOGWDG5         Phone: +49 551 201516 | No claim intended

