From: utzoo!hcr!rrg
Newsgroups: net.news.b
Title: Re: netnews problems on an 11/23 running xenix
Article-I.D.: hcr.123
Posted: Sat May 29 16:20:44 1982
Received: Sat May 29 16:41:41 1982
References: floyd.243

Readnews as distributed will memory-fault on PDP-11s without split-I/D;
this is mentioned in the installation instructions and has nothing to
do with anything non-standard in HCR's XENIX.  The problem is that
readr() allocates a VERY large amount of data on the stack--almost
10Kb--and there aren't enough segmentation registers to accommodate it
on a small 11; a 10Kb stack requires two registers and eats up 16Kb of
address space.

The simplest way to get readnews to run on an 11/23 is to move the two
huge structures in readr() out of the stack and into the BSS.  Change
the declaration

	struct hbuf hbuf1, hbuf2, *hptr;/* for minusing			*/

to
	static struct hbuf hbuf1, hbuf2;/* for minusing			*/
	struct hbuf *hptr;

Recompile readnews as an ordinary (407-type) a.out; a shared-text
(410-type) binary runs into the same problem with segmentation
registers.  It shouldn't be necessary to change any of the sizes in
defs.h, though by reducing some of them it might be possible to recover
enough space to make a 410 binary fit.  On a PDP-11 XENIX system it
should be recompiled as a 23fixed (text-overlaid) binary, using
"cc -Z"; this allows the text to be shared without the need to reduce
table sizes.