Opened 16 years ago

Closed 16 years ago

#336 closed defect (fixed)

valueweightsource1 is failing when assertions are on

Reported by: Richard Boulton Owned by: Richard Boulton
Priority: normal Milestone: 1.1.0
Component: Matcher Version: SVN trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: All

Description

From a comment from Olly in ticket #295 (pulling this out as a separate issue so it doesn't get forgotten):

valueweightsource1 is failing when assertions are on (I checked revision 11840 which failed, so it's not a change made since this; revision 11837 skips this test):

$ ./apitest -b multi_chert valueweightsource1 -v
Running tests with backend "multi_chert"...
Running test: valueweightsource1...
RAW
 AssertionErrorAssertionError: matcher/multimatch.cc:267:
within_DBL_EPSILON(wt,pl->recalc_maxweight()) : values were 135 and 100

Change History (2)

comment:1 by Richard Boulton, 16 years ago

Status: newassigned

This turns out to be a long-standing bug in the matcher. Specifically, the situation here is that we have two sub-databases, each with a postlist tree consisting of a single posting source. For the first sub-database, the maxweight is 135, for the second it is 100.

In matcher/mergepostlist.cc, when the first posting source has been exhausted, this source is replaced by an EmptyPostList with a maxweight of 0. The result of recalc_maxweight() therefore drops to 100, but matcher->recalc_maxweight() wasn't being called, resulting in the assertion failure.

This was only happening with multi_chert, because for multi_flint the maxweight for both posting sources is DBL_MAX (since the upper bound of the values isn't stored).

comment:2 by Richard Boulton, 16 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r11976.

Note: See TracTickets for help on using tickets.