Mailing List Archive

add_doc() core dumps
Hello,

I am getting "Bus Error(coredump)" when I call add_doc() I am using the
following versions:

Solaris 2.8
Perl 5.8.8
KinoSearch 0.162

My script to generate the index is:

use strict;
use warnings;
use Cwd;
use File::Spec;
use KinoSearch::InvIndexer;
use KinoSearch::Analysis::PolyAnalyzer;

my $dir = cwd();
my $source_dir = '/u/jarnold/docs_example/';
my $path_to_invindex = File::Spec->catdir( $dir, 'kindex' );
my @filenames = ("jess.txt");
my $analyzer = KinoSearch::Analysis::PolyAnalyzer->new( language =>
'en', );

my $invindexer = KinoSearch::InvIndexer->new(
analyzer => $analyzer,
invindex => $path_to_invindex,
create => 1,
);

$invindexer->spec_field( name => 'fname' );
$invindexer->spec_field( name => 'text' );

foreach my $filename (@filenames)
{
my $filepath = File::Spec->catfile( $source_dir, $filename );
open( my $fh, '<', $filepath )
or die "couldn't open file '$filepath': $!";

my $content = do { local $/; <$fh> };
my $doc = $invindexer->new_doc();
$doc->set_value( fname => $filename );
$doc->set_value( text => $content );

$invindexer->add_doc($doc);
}

$invindexer->finish();

Thanks,
Jessica Arnold


_______________________________________________
KinoSearch mailing list
KinoSearch@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch
Re: add_doc() core dumps [ In reply to ]
On Feb 20, 2008, at 12:09 PM, Jessica Arnold wrote:

> I am getting "Bus Error(coredump)" when I call add_doc() I am using
> the following versions:
>
> Solaris 2.8
> Perl 5.8.8
> KinoSearch 0.162

Did KinoSearch pass its tests? I don't see anything out of the
ordinary in your code sample.

I suspect a long-standing memory alignment issue. If that's the case,
the devel branch is now ok, but since backporting the fix was
impossible, the stable release isn't.

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


_______________________________________________
KinoSearch mailing list
KinoSearch@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch