Mailing List Archive

Segfault with KinoSearch SVN
Using KinoSearch from subversion, this minimal test case causes a
segmentation fault.

#!/usr/bin/perl

use strict; use warnings;

package Schema::NoAnalyze;
use base qw( KinoSearch::Schema::FieldSpec );
sub analyzed { 0 }

package Schema;
use base qw( KinoSearch::Schema );
use KinoSearch::Analysis::PolyAnalyzer;

our %fields = ( noanalyze => 'Schema::NoAnalyze' );

sub analyzer { KinoSearch::Analysis::PolyAnalyzer->new( language => 'en' ) }

package main;

use KinoSearch::InvIndexer;
use KinoSearch::Searcher;

my $index_dir = "test_index";

my $index = KinoSearch::InvIndexer->new(
invindex => Schema->clobber($index_dir)
);
$index->add_doc({ noanalyze => 'value' });
$index->finish();

my $query = KinoSearch::Search::BooleanQuery->new;
my $term = KinoSearch::Search::TermQuery->new(
term => KinoSearch::Index::Term->new( noanalyze => 'value' ),
);
$query->add_clause( query => $term, occur => 'SHOULD' );

my $searcher = KinoSearch::Searcher->new(
invindex => Schema->open($index_dir)
);
$searcher->search( query => $query );
Segfault with KinoSearch SVN [ In reply to ]
On Jul 9, 2007, at 5:59 AM, Edward Betts wrote:

> Using KinoSearch from subversion, this minimal test case causes a
> segmentation fault.

Edward, you're awesome about supplying these test cases.
Unfortunately, in this instance, I'm not able to duplicate the
problem. The script proceeds without incident on both FreeBSD and
RedHat 9, and Valgrind reveals no memory errors.

I suggest you try rebuilding KS from scratch, then run it again --
try "./Build distclean", then the usual "perl Build.PL", etc.

If you're still having problems, let me know the architecture.

Thanks, and I look forward to resolving this for you one way or another.

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/
Segfault with KinoSearch SVN [ In reply to ]
On 10/07/07, Marvin Humphrey <marvin@rectangular.com> wrote:
> I suggest you try rebuilding KS from scratch, then run it again --
> try "./Build distclean", then the usual "perl Build.PL", etc.

Sorry for the false report. I rebuilt as you suggested and the
segfault went away.
--
Edward Betts
Segfault with KinoSearch SVN [ In reply to ]
On Jul 10, 2007, at 2:44 AM, Edward Betts wrote:

> On 10/07/07, Marvin Humphrey <marvin@rectangular.com> wrote:
>> I suggest you try rebuilding KS from scratch, then run it again --
>> try "./Build distclean", then the usual "perl Build.PL", etc.
>
> Sorry for the false report. I rebuilt as you suggested and the
> segfault went away.

It's not really a false report. You ran into a bug in the KS build
regime. Build.PL doesn't track dependencies for C header files. If
a struct changes in one, it doesn't know to rebuild all the files
that #include it.

I've opened an RT issue. Thanks for speaking up.

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/