[Xapian-discuss] AssertParanoid() failure in MultiMatch::getorrecalc_maxweight()

Rocco Caputo rcaputo at pobox.com
Wed Jun 14 19:22:38 BST 2006


While tracking down the stack smash (still working on that), I came  
across a failed AssertParanoid() in MultiMatch::getorrecalc_maxweight 
().  I don't know how the post list is being modified without also  
making recalc_w_max true.

recalculate_w_max: 0
fetched max weight = 13.1034
recalculated max weight = 12.2844
difference between fetched and recalculated = 0.81896
assertion will fail

My version of the code is 0.9.6 plus some debugging cerr's:

Xapian::weight
MultiMatch::getorrecalc_maxweight(PostList *pl)
{
     DEBUGCALL(MATCH, Xapian::weight,  
"MultiMatch::getorrecalc_maxweight", pl);
     Xapian::weight wt;
cerr << "recalculate_w_max: " << recalculate_w_max << "\n";
     if (recalculate_w_max) {
         DEBUGLINE(MATCH, "recalculating max weight");
         wt = pl->recalc_maxweight();
cerr << "new max weight = " << wt << "\n";
         recalculate_w_max = false;
     } else {
         wt = pl->get_maxweight();
cerr << "fetched max weight = " << wt << "\n";
cerr << "recalculated max weight = " << pl->recalc_maxweight() << "\n";
cerr << "difference between fetched and recalculated = " << fabs(wt -  
pl->recalc_maxweight()) << "\n";
if (!(fabs(wt - pl->recalc_maxweight()) < 1e-9)) cerr << "assertion  
will fail\n";
         AssertParanoid(fabs(wt - pl->recalc_maxweight()) < 1e-9);
cerr << "paranoid assertion passed\n";
     }
     DEBUGLINE(MATCH, "max possible doc weight = " << wt);
     RETURN(wt);
}

-- 
Rocco Caputo - rcaputo at pobox.com





More information about the Xapian-discuss mailing list