Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: $Revision: 1.6.2.16 $; site haddock.UUCP Path: utzoo!watmath!clyde!cbosgd!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!bbnccv!haddock!rob From: rob@haddock.UUCP Newsgroups: net.news.notes Subject: Re: Nfxmit core Message-ID: <102300001@haddock.UUCP> Date: Sun, 12-Jan-86 20:04:00 EST Article-I.D.: haddock.102300001 Posted: Sun Jan 12 20:04:00 1986 Date-Received: Tue, 14-Jan-86 05:55:50 EST References: <4600001@wvlpdp.UUCP> Lines: 43 Nf-ID: #R:wvlpdp:4600001:haddock:102300001:000:1591 Nf-From: haddock!rob Jan 12 20:04:00 1986 [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: * = + * * i.e. = * 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