Rocco Caputo
2006-Jun-14  19:23 UTC
[Xapian-discuss] AssertParanoid() failure in MultiMatch::getorrecalc_maxweight()
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@pobox.com
Olly Betts
2006-Jun-14  19:39 UTC
[Xapian-discuss] AssertParanoid() failure in MultiMatch::getorrecalc_maxweight()
On Wed, Jun 14, 2006 at 02:22:38PM -0400, Rocco Caputo wrote:> 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.Bit of a long-shot, but is this with the remote backend? I noticed recently that MSetPostList doesn't seem quite right in 0.9.6 (it will overreport the current maxweight sometimes in a way which is harmless to the correctness of the results, but may hinder early termination). Otherwise, is the code which produces this in a state where you could sensibly send it to me? Cheers, Olly