UUCP bug

utzoo!decvax!ittvax!swatt utzoo!decvax!ittvax!swatt
Sun Aug 30 17:53:07 AEST 1981


	From decvax!ucbvax!unix-wizards Thu Aug 27 05:21:19 1981
			    : fa.unix-wizards
	>From pur-ee!aef at Berkeley Thu Aug 27 04:04:14 1981
	I have discovered that whenever sending a large number of files via
	uucp, segmentation faults crop up.  It is very consistent.  I have
	looked at diagnotic output level 4; right after the 40th printing of
	"*** TOP ***" and the "role=1" messages in cntrl.c, the fault occurs.
	Best I can tell it occurs somewhere in anlwrk.c since gtwvec() is
	called right after "*** TOP ***" message is printed, and if gtwvec had
	returned sucessfully, another debug message would have come out.

	Anyone else see this error, or have a fix?  The version we run here is
	basically the 4bsd distributed sources with a few local mods with
	regard to times, etc. only.  I will continue to check, but would
	appreciate any comments about this from others.

			Art Feather (pur-ee!aef)


I believe I can shed some light on this, as I ran into the same problem
when adapting V7 UUCP for ONYX.  If you look very carefully at the
routine "cntrl" in the file mentioned by Art, you will notice the array
passed to "gtwvec" is local, that is, on the stack.  The debug message
Art is expecting is the result of a "sprintf (...." statement sometime
after the "gtwvec" call.  The problem is caused (I believe) by the fact
that gtwvec modifies some of the cells in the array it is passed, but
not others.  However the sprintf call attempts to use ALL of these
values as string pointers. If you give sprintf a null pointer, it just
prints "(null)" (or ignores it, in some versions).  However if you give
it an illegal address it will cause a trap.

Why the gods were so kind to pdp11 and VAX users I will never
understand, but this non-initialized array seemed to have some
non-fatal values on these machines.  ONYX blew up consistently.  The
solution is to initialize the array at the top of the control loop.
Diff listing follows.
~~~~~~~~~~~~~~~~~~~~~
diff goodcntrl.c badcntrl.c
~~~~~~~~~~~~~~~~~~~~~
1c1
< 	/*  cntrl  2.8  8/3/81 */
---
> 	/*  cntrl  2.7  5/24/79  21:37:36  */
6c6
< static char SiD[] = "@(#)cntrl	2.8 (ITT)";
---
> static char SiD[] = "@(#)cntrl	2.7";
119,122d118
< 		/* asw: 8/3/81: fixed to initialize wrkvec at top of loop */
< 		/* set wrkvec array to known state */
< 		for (i = 0; i < (sizeof wrkvec/sizeof wrkvec[0]); i++)
< 			wrkvec[i] = 0;



More information about the Comp.unix.wizards mailing list