[net.news.notes] Nfxmit core

john@wvlpdp (01/03/86)

	Does anyone out there know why nfxmit would core dump when
	queueing notes.

	We have a PDP 11/73 running Ultrix-11 Version 2.0.
	The 11/73 is a seperate I & D processor.


	Nfxmit always seems to crap out on large note files with many entries
	each having one or more responses.  Is this due to limited address
	space on PDP 11's?


				John A. Ebersold

				Diplomacy is the art of letting someone
				else have your way.

				ctvax!trsvax!doc!wvlpdp!john

rob@haddock.UUCP (01/13/86)

[Take that! And That!  Don't take this!  Take the other thing!]

john@wvldpdp (John A. Ebersold) wonders why nfxmit dumps core when
queueing large notefiles.  The answer almost certainly is a
16-bits-ain't-enough coding error in recsio.c.
Here is an excerpt from my copy of recsio.c:
(Dont forget to fix all 4 instances of this bug!)

/*
 * In all of {get,put}{n,r}rec below, explicitly cast one
 * of the members of the rhs of the "where" assignment
 * to long.  This prevents a problem in 16 bit machines
 * whereby
 *	sizeof (*descr) + n * sizeof (*note)
 * is evaulated thusly:
 *	<long> = <int> + <int> * <int>
 * i.e.	<long> = <int>
 * thus losing some of the information.  You will have this
 * problem on your machine as soon as "n * sizeof (*not)" exceeds
 * MAXINT  (or maybe MAXUNSIGNED.)
 */

getnrec (io, n, note) struct note_f *note;		/* n is the number of the note to get.  0 is policy note */
struct io_f *io;
{
    long    where;					/* going to seek here eventually */
    struct descr_f *descr;				/* for sizeof below */

    x (n < 0, "getnrec: negative recnum");
#if	0
    where = sizeof (*descr) + n * sizeof (*note);
#else
    where = sizeof (*descr) + (long)n * sizeof (*note);
#endif
    x (lseek (io -> fidndx, where, 0) < 0, "getnrec: seek");
    x (read (io -> fidndx, note, sizeof *note) < sizeof *note, "getnrec: read");
}

Rob Adams {decvax ! cca | yale | ihnp4 | cbosgd}!ima!rob
{bbncca | harvard | zurton | cfib | mit-ems | wjh12 }!ima!rob
{uscvax | ucla-vax | vortex}!ism780!rob
Interactive Systems, 7th floor, 441 Stuart st, Boston, MA 02116; 617-247-1155