From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 28-FEB-1991 03:18:43.27
To:	ARISIA::EVERHART
CC:	
Subj:	SMGSHR Patch for ANU-NEWS dropping into newsgroups while scrolling

From:	RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP@CRDGW2
To:	Everhart@Arisia@MRGATE

Received:  by crdgw1.ge.com (5.57/GE 1.87)
	 id AA21267; Thu, 28 Feb 91 03:10:16 EST
Received: From UCBVAX.BERKELEY.EDU by CRVAX.SRI.COM with TCP; Wed, 27 FEB 91 04:47:18 PST
Received: by ucbvax.Berkeley.EDU (5.63/1.42)
	id AA25949; Wed, 27 Feb 91 04:32:55 -0800
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 27 Feb 91 09:15:44 GMT
From: infopiz!mark@decwrl.dec.com
Organization: INFO COMM - Computer Consulting, Redwood City, Ca
Subject: SMGSHR Patch for ANU-NEWS dropping into newsgroups while scrolling
Message-Id: <6667.27cb0840@infocomm.com>
References: <1991Feb18.013223.789@vixvax.mgi.com>, <1991Feb19.085915.1@sao.aarnet.edu.au>, <1991Feb19.123812.1@rogue.llnl.gov>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

I'm posting this to comp.os.vms and vmsnet.misc also so I review the problem:

In article <1991Feb18.013223.789@vixvax.mgi.com>, glass@vixvax.mgi.com writes:
In article <1991Feb9.134458.1@ptavv.llnl.gov>, oberman@ptavv.llnl.gov writes:
> >  
> > This is a VMS 5.4 SMG problem. What happens is that after certain keyboard
> > commands, the next key that is defined is read as a <cr>. This includes cursor
> > keys, numeric keypad keys and defined control keys.
> 
> Confirmed - it is a SMG bug.  It was a long an frustrating debugging session,
> but I finally found the sucker.  The bug is in the READ_COMPOSED_LINE
> routine.  Basically, there is an uninitialized variable that is initially
> set to what ever random stuff is on your stack when you call the routine.
> The problem is triggered whenever you do a scrolling operation on the
> newsgroups directory, and you go to one of the following newsgroups numbers:
> 44, 556, 1545, 1553, 1617, or 2096  (those happen to be the numbers for
> SS_ABORT, SS_TIMEOUT, SS_CONTROLO, SS_CONTROLY, SS_CONTROLC, and SS_CANCEL).
> 
> The stack offset of the key variable is slightly different between VMS 5.3
> and 5.4, so I can very well believe that the problem is sensitive to the
> release of VMS, the version of your C compiler, and whether or not you
> enabled optimization when compiling.
> 
> Is there anyone out there who has some good contacts with DEC and would
> like to pass this on (I can provide more details)?  Believe it or not,
> I don't really work on VMS that much, so I've never done any trouble
> reports to DEC.

 
In article <1991Feb19.123812.1@rogue.llnl.gov>, oberman@rogue.llnl.gov writes:
> In article <1991Feb19.085915.1@sao.aarnet.edu.au>, gih900@sao.aarnet.edu.au writes:
>> 
>> I'M IMPRESSED!
>> 
>> nice work Bill!
> 
> I, too an impressed! This was more than a little tricky.
> 
> At Bill's request I have submited his findings to DEC and hope to have a
> response shortly. NOTE: That's a response, not a fix. But I will keep this
> newgroup updated on whatever DEC comes up with.
> 

I also am VERY impressed with Bill's efforts!

Now that I've been teased with knowledge of why I've been bothered on and off
by this problem for a LONG time, I couldn't possibly wait for Digital to get
around to fixing and have that fix propagate through the field test and release
cycle.

I tried to reproduce Bill's debugging efforts since he didn't actually mention
the explicit uninitialized variable.  I now know why he was so frustrated in
his debugging efforts.  I had to pull quite a few tricks out of my hat to get a
version of news that reproduced the problem (a newly compiled one didn't).

After a while, I simply said, heck, why not convince the routine
SMG$READ_COMPOSED_LINE to initialize all of it's local variables to zero,
instead of tracking down the specific one.  The following patch works for
the version of SMGSHR.EXE supplied with VMS V5.4-1.

	$ SET DEFAULT SYS$COMMON:[SYSLIB]
	$ PATCH SMGSHR.EXE
	REPLACE/INSTR 244F
	'CLRL B^0FC(FP)'
	EXIT
	'MOVC5 #0, (SP), #0, #2F0, (SP)'
	EXIT
	UPDATE
	EXIT
	$ RUN SYS$SYSTEM:INSTALL
	SYS$SHARE:SMGSHR/REPLACE
	$

An UNTESTED patch that does the same basic thing for the SMGSHR for VMS V5.3-1:

	$ SET DEFAULT SYS$COMMON:[SYSLIB]
	$ PATCH SMGSHR.EXE
	INSERT/INSTR 21EE
	'MOVAB W^0FD0C(SP),SP'
	'MOVC5 #0, (SP), #0, #2F4, (SP)'
	EXIT
	UPDATE
	EXIT
	$ RUN SYS$SYSTEM:INSTALL
	SYS$SHARE:SMGSHR/REPLACE
	$


This patch will remove the problem until DEC gets around to fix things.
I'll recreate and post the similar patches to above until DEC gets to it.

-- 
Mark Pizzolato - INFO COMM Computer Consulting, Redwood City, Ca
PHONE:	(415)369-9366	UUCP:  decwrl!infopiz!mark or uunet!lupine!infopiz!mark
DOMAIN:	mark@infocomm.com

