[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] [ANNOUNCE] First Leafnode-2.0 beta version



On Fri, Oct 27, 2000 at 05:53:09PM +0200, Cornelius Krasel wrote:
> Joerg Dietrich wrote:
> 
> > On Tue, Oct 24, 2000 at 07:22:00PM +0200, Cornelius Krasel wrote:
> > > Leafnode-2.0b1 contains at least the following bugs:
> > > - fetchnews sometimes coredumps on fixxover() (reported by Joerg
> > >   Dietrich).
> > 
> > And here's the patch to fix it. It should obvious what was wrong.
> > But I think this bug just showed up because of a much deeper
> > problem:
> > 
> > >From getxover():
> > 
> > 	    if ( overview ) {
> >                 i = findxover(art);
> >                 if ( i >= 0 ) {
> >                     xoverinfo[i].exists = 1;
> >                     continue;
> >                 }
> >             }
> > 
> > Here findxover() is called before the xoverinfo array is sorted.
> 
> In getxover(), one of the first things is to read the overview file
> (which is already sorted) into memory and parse it (i.e. a sorted
> xoverinfo array is created). Then, these data are compared with the
> files on disk, in case some files have been added after construction
> of the .overview file. In that part occurs the code snippet quoted

Isn't the overview we read from disk overwritten by

memset( xoverinfo, 0, sizeof(struct xoverinfo) * (xcount+current+1) );

which occurs earlier?

> by Joerg. The directory is read, and for each directory entry the
> code above tests whether it already exists in the xoverinfo array.
> In that case, the "exists"-flag is set to 1.

You forgot the rest :-) If the article is new, i.e. not present
in the .overview on disk, the new overview line is generated and
added to the xoverview array. From now on the array is unsorted
and calling findxover() is pointless.

I stumbled over it in an extreme case: de.newusers.info is a
group with weekly information postings that supersede their
earlier incarnation. Once a week when they're all posted the 
overview file contains 15 lines of articles that don't exist
anymore, and de/newusers/info/ contains 15 articles that are not
in the old .overview file. Lets say we've been through the

while ( (de = readdir(d)) != NULL ) {

loop 10 times. Then xoverinfo[] contains nothing but 10 unsorted
entries. And you let findxover() run over this. Don't expect any
sensible output.

Or do I miss something?

Regards,
	Jo:rg

-- 
Fortune cookie of the day:
One family builds a wall, two families enjoy it.

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list