[net.news.b] netnews problems on an 11/23 running xenix

atr (05/28/82)

	We are trying to bring up readnews under HCR's xenix on a
PDP-11/23 and we keep getting

memory fault -- core dumped.

	We tried lowering the allocations in <param.h> but we still
get the memory fault when we try to run it. Also inews gives us
segmentation violation when we try to post a news article.

	Can anyone help us? Has anyone had the same problem with xenix?
HCR can you hear me?

						Andrew T. Rodnite
						Periphonics inc.
						4000 Veterans Memorial Hwy.
						Bohemia, N.Y. 11716
						(516) 467-0500
						harpo!floyd!peri!andy

rrg (05/29/82)

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.