Re: Segmentation fault in matcher/queryoptimiser

Robert Stepanek <[email protected]> Wed, 02 Aug 2017 15:06:27 +0200
Newsgroups gmane.comp.search.xapian.devel
Message-ID <1501679187.468331.1060754024.459EFAEF@webmail.messagingengine.com>
Olly, thanks for your feedback.

On Mon, Jul 31, 2017, at 23:29, Olly Betts wrote:
> On Mon, Jul 31, 2017 at 09:24:29AM +0200, Robert Stepanek wrote:
> > We'd appreciate any hints on how to fix this. I've written up our
> > findings and solution attempts below. Should we post this on trac?
> 
> Yes, it'd be good to have a ticket to track this.

I've created ticket #752 (https://trac.xapian.org/ticket/752).
 
> > Should we probably keep it and make QueryOptimiser take ownership?
> 
> That's exactly how I fixed a similar earlier issue (see commit
> 2299e1d21e39f1295c81833ccd5037f746f4744a).
> 
> We should probably address both issues consistently.  If setting the hint
> to NULL works, we should probably evaluate that approach as it avoids
> the overhead of tracking ownership and of checking if we're about to
> delete the current hint.

We are testing the patch to set hint to NULL currently. I'll wait this
week to see if we experience any crashers related to it. I am not deep
enough into the query optimiser code to know which approach is better in
term of performance. If taking ownership is preferred I could make the
context resetter aware which postlist member to skip during the free().

Cheers,
Robert