From:	CRDGW2::CRDGW2::MRGATE::"SMTP::DRYCAS.CLUB.CC.CMU.EDU::VMSNET-REQUEST" 27-JUN-1991 06:59:43.87
To:	ARISIA::EVERHART
CC:	
Subj:	RE: Problems with rec_badhdr's; Causes?? (and fix)

From:	vmsnet-request@DRYCAS.CLUB.CC.CMU.EDU@SMTP@CRDGW2
To:	everhart@arisia@MRGATE

Received:  by crdgw1.ge.com (5.57/GE 1.101)
	 id AA22045; Thu, 27 Jun 91 06:38:54 EDT
Resent-From: vmsnet-request@DRYCAS.CLUB.CC.CMU.EDU
Resent-Message-Id:  <9106271038.AA22045@crdgw1.ge.com>
Return-Path: uucp@mccall.uucp
Received: from harris.cis.ksu.edu by DRYCAS.CLUB.CC.CMU.EDU with PMDF#10209;
 Thu, 27 Jun 1991 06:32 EST
Received: from deimos.cis.ksu.edu by harris.cis.ksu.edu (5.58) id AA10080; Thu,
 27 Jun 91 05:32:13 CDT
Received: by deimos.cis.ksu.edu (5.58a-3B15) id AA15445; Thu, 27 Jun 91
 06:28:55 EDT
Received: by mccall.com (DECUS UUCP /1.3-1/2.5/); Thu, 27 Jun 91 05:09:11 CDT
Resent-Date: Thu, 27 Jun 1991 06:33 EST
Date: 26 Jun 91 21:52:10 PDT
From: cmkrnl!jeh@crdgw1
Subject: RE: Problems with rec_badhdr's; Causes?? (and fix)
To: mccall!vmsnet-newsgate
Errors-To: vmsnet-request@DRYCAS.CLUB.CC.CMU.EDU
Reply-To: vmsnet@DRYCAS.CLUB.CC.CMU.EDU
Message-Id: <1991Jun26.215210.131@cmkrnl.uucp>
X-Vms-To: vmsnet-newsgate@mccall.uucp
Organization: Kernel Mode Consulting, San Diego CA

In article <1991Jun26.200206.1542@spcvxb.spc.edu>, terry@spcvxb.spc.edu 
(Terry Kennedy, Operations Mgr.) writes:
> In article <1991Jun26.150141.237@drycas.club.cc.cmu.edu>,
>  alf@drycas.club.cc.cmu.edu writes:
> 
>> The files seem to be going through OK on the DECserver line, but not even close
>> on the direct line.  But I do get mega errors!!!  What causes these badhdr
>> errors??  Is it the fact that the remote system is running BSD Unix??  Are
>> there any good books that describe the internals of how uucp works??  Well
>> thanks abunch to all that reply to this problem of mine...
> 
>   I believe "header not DLE" was a known incompatibility in early DECUS UUCP
> versions. 

The problem is twofold -- the BSD UUCP should not be sending a pair of null
bytes before every header, and we shouldn't be so sensitive to interpacket
line noise.  

> We'll have to wait for Jamie to tell us if V1.3 runs on VMS V4.x,

Don't actually know.  All versions *after* V1.1 were built on VMS V5.x systems,
and little effort was made to see if they would link or run under V4.x.  
Running under 4.x may simply be a matter of relinking, or it may not.  There
may be some V5 dependencies either in the code or in the command procedures.

> There may be a patch for this particular problem (I seem to recall there 
> was) 

indeed.  It (along with an explanation of what is happening) follows my sig.  

	--- Jamie Hanrahan, Kernel Mode Consulting, San Diego CA
Chair, VMS Internals Working Group, U.S. DECUS VAX Systems SIG 
Internet:  jeh@dcs.simpact.com, hanrahan@eisner.decus.org, or jeh@crash.cts.com
Uucp:  ...{crash,scubed,decwrl}!simpact!cmkrnl!jeh

Background:  Berkeley 4.3BSD Unix uucp mistakenly sends two null bytes between 
each pair of packets.  This causes DECUS uucp to log huge numbers of errors 
during connections with these systems.  The right fix is to get the offending
neighbors to acquire 4.3+, which doesn't have this problem, but until then, 
the following will serve.  

If you have DEC's C compiler, you can fix this with a trivial source change.
(If you don't have the C compiler, see below.)

Set your default directory to [uucp.devel.uucp.src], edit giowvms.c, and 
change the line that says

static	int gerrlim = 20;	/* Error threshold beyond which the DEBUG */

	to

static	int gerrlim = 1000000000;	/* Error threshold beyond which the DEBUG */

or any huge number.

Then, from the same default directory, issue the DCL commands

	$ @[--]environ	! set up build environment
	$ make build	! compile and link executables into [.BLD] directory

If no errors, wait for all uucp calls to terminate, kill off your uucico
daemon, and 

	$ make install	! copy executables into uucp_bin:, do appropriate
			! INSTALLs 
	$ @uucp_bin:uucp_systartup batch

If you don't have the VAX C compiler:

Following is a VMS_SHARE file containing a tiny command procedure which will
patch uucico.exe to eliminate setting the protocol debug option bits after
20 errors are noticed.  (It does this by changing the limit to 40000000 hex, 
which is somewhat more than one billion.)  

This assumes that your uucico.exe is the same one that was included in 
DECUS uucp V1.1.  (If it isn't, recover a copy of the V1.1 "original" from 
the distribution tape.)  The patch command procedure makes a reasonable number
of checks to ensure that it's changing the right thing; if a mismatch is found
it will make no changes.

To use this:

1. Save everything following the pair of dotted lines in a file.

2. Invoke the resulting file as a command procedure.  It will create
the file PATCH_HDR0.COM , and verify that its contents are correct.  

3. Set your default directory to UUCP_BIN: 

4. Invoke PATCH_HDR0.COM .  The last three lines of output should be:

	old:	000038A0:  00000014
	new:	000038A0:  40000000
	%PATCH-I-WRTFIL, updating image file...

5. Edit your control and systems files to ensure that bits 
   7 through 10, that is, the bits represented by the octal
   mask 003600, are CLEAR in all debug masks.  

6. Wait for any uucp calls (incoming or outgoing) to terminate.  

7. Stop the uucico and uuxqt daemon processes (batch jobs).  

8. Type the following commands at the DCL prompt:

	$ @uucp_bin:uucp_systartup install
	$ @uucp_bin:uucp_systartup batch

...and the "HDR[0] not DLE" messages should be gone.  

It may seem odd to send a hundred or so lines of VMS_SHARE in order to send
a six-line command procedure, but with PATCH/ABSOLUTE you're really working
without a net, and VMS_SHARE is the quickest and easiest way to make certain 
that the file arrives exactly as intended.  

Thanks to George Carrette, who suggested this fix in source form.  

	--- Jamie Hanrahan, Simpact Associates, San Diego CA
Chair, VMSnet [DECUS uucp] and Internals Working Groups, DECUS VAX Systems SIG 
Internet:  jeh@simpact.com, or if that fails, jeh@crash.cts.com
Uucp:  ...{crash,scubed,decwrl}!simpact!jeh

$! ...................... Cut between dotted lines and save. .....................
$!.............................................................................
$! VAX/VMS archive file created by VMS_SHARE V06.03 20-Oct-1988.
$!
$! VMS_SHARE was written by James Gray (Gray:OSBUSouth@Xerox.COM) from
$! VMS_SHAR by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au).
$!
$! To unpack, simply save, concatinate all parts into one file and
$! execute (@) that file.
$!
$! This archive was created by user JEH
$! on  9-SEP-1989 22:30:29.22.
$!
$! It contains the following 1 file:
$!        PATCH_HDR0.COM
$!
$!==============================================================================
$ SET SYMBOL/SCOPE=( NOLOCAL, NOGLOBAL )
$ VERSION = F$GETSYI( "VERSION" )
$ IF VERSION .GES "V4.4" THEN GOTO VERSION_OK
$ WRITE SYS$OUTPUT "You are running VMS ''VERSION'; ", -
    "VMS_SHARE V06.03 20-Oct-1988 requires VMS V4.4 or higher."
$ EXIT 44 
$VERSION_OK:
$ GOTO START
$
$UNPACK_FILE:
$ WRITE SYS$OUTPUT "Creating ''FILE_IS'"
$ DEFINE/USER_MODE SYS$OUTPUT NL:
$ EDIT/TPU/COMMAND=SYS$INPUT/NODISPLAY/OUTPUT='FILE_IS'/NOSECTION -
    VMS_SHARE_DUMMY.DUMMY

b_part := CREATE_BUFFER( "{Part}", GET_INFO( COMMAND_LINE, "file_name" ) );
s_file_spec := GET_INFO( COMMAND_LINE, "output_file" );SET( OUTPUT_FILE, b_part
, s_file_spec ); 
b_errors := CREATE_BUFFER( "{Errors}" );i_errors := 0; 
pat_beg_1 := ANCHOR & "-+-+-+ Beginning";
pat_beg_2 := LINE_BEGIN & "+-+-+-+ Beginning";
pat_end := ANCHOR & "+-+-+-+-+ End";
pat_trail := " " & LINE_END;POSITION( BEGINNING_OF( b_part ) ); LOOP b 
:= SEARCH( pat_trail, FORWARD); EXITIF b=0; POSITION( END_OF( b ) )
; LOOP MOVE_HORIZONTAL( -1 ); EXITIF CURRENT_CHARACTER <> ' '; ERASE_CHARACTER
( 1 ); EXITIF CURRENT_OFFSET=0; ENDLOOP; ENDLOOP; POSITION( BEGINNING_OF
( b_part ) ); i_append_line := 0; LOOP EXITIF MARK( NONE ) = END_OF( b_part )
; s_x := ERASE_CHARACTER( 1 ); 
  IF s_x = "+" THEN r_skip := SEARCH( pat_beg_1, FORWARD, EXACT ); IF r_skip <
> 0 THEN 
      s_x := ""; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ERASE_LINE; ENDIF; ENDIF; 
  IF s_x = "-" THEN r_skip := SEARCH( pat_end, FORWARD, EXACT ); IF r_skip <
> 0 THEN 
      s_x := ""; MOVE_HORIZONTAL( -CURRENT_OFFSET ); m_skip := MARK( NONE )
; r_skip := SEARCH( pat_beg_2, FORWARD, EXACT ); IF r_skip <> 0 THEN POSITION
( END_OF( r_skip ) ); MOVE_HORIZONTAL( -CURRENT_OFFSET ); MOVE_VERTICAL( 1 )
; MOVE_HORIZONTAL( -1 ); ELSE POSITION( END_OF( b_part ) ); ENDIF; ERASE
( CREATE_RANGE( m_skip, MARK( NONE ), NONE ) ); ENDIF; ENDIF; 
  IF s_x = "V" THEN 
    s_x := ""; IF i_append_line <> 0 THEN APPEND_LINE; MOVE_HORIZONTAL
( -CURRENT_OFFSET ); ENDIF; i_append_line := 1; MOVE_VERTICAL( 1 ); ENDIF; 
  IF s_x = "X" THEN 
    s_x := ""; IF i_append_line <> 0 THEN APPEND_LINE; MOVE_HORIZONTAL
( -CURRENT_OFFSET ); ENDIF; i_append_line := 0; MOVE_VERTICAL( 1 ); ENDIF; 
  IF s_x <> "" THEN i_errors := i_errors + 1; s_text := CURRENT_LINE; POSITION
( b_errors ); 
    COPY_TEXT( "The following line could not be unpacked properly:" )
; SPLIT_LINE; COPY_TEXT( s_x ); COPY_TEXT( s_text ); POSITION( b_part )
; MOVE_VERTICAL( 1 ); ENDIF; ENDLOOP; POSITION( BEGINNING_OF( b_part ) ); LOOP 
  r_x := SEARCH( "`", FORWARD, EXACT ); EXITIF r_x = 0; POSITION( r_x )
; ERASE_CHARACTER( 1 ); 
  IF CURRENT_CHARACTER = "`" THEN MOVE_HORIZONTAL( 1 ); ELSE COPY_TEXT( ASCII
( INT( ERASE_CHARACTER( 3 ) ) ) ); ENDIF; ENDLOOP; IF i_errors = 0 THEN SET
( NO_WRITE, b_errors, ON ); ELSE POSITION( BEGINNING_OF( b_errors ) ); 
  COPY_TEXT( FAO( "The following !UL errors were detected while unpacking !AS"
, i_errors, s_file_spec ) ); SPLIT_LINE; 
  SET( OUTPUT_FILE, b_errors, "SYS$COMMAND" );ENDIF; EXIT; 
$ DELETE VMS_SHARE_DUMMY.DUMMY;*
$ CHECKSUM 'FILE_IS
$ WRITE SYS$OUTPUT " CHECKSUM ", -
  F$ELEMENT( CHECKSUM_IS .EQ. CHECKSUM$CHECKSUM, ",", "failed!,passed." )
$ RETURN
$
$START:
$ FILE_IS = "PATCH_HDR0.COM"
$ CHECKSUM_IS = 926039571
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X$ patch/absolute uucico.exe
Xverify 38a0=14,0,1
Xreplace 38a0=14
X40000000
Xexit
Xupdate
$ GOSUB UNPACK_FILE
$ EXIT
$! (end)
