Mark Blythe
2007-Mar-18 05:52 UTC
[Xapian-discuss] QueryParser + Stopper broken? (at least from Perl)
Hi, This is my first day experimenting with Xapian, and it was working quite well until I tried using a stopper. I'm using the Perl bindings (Search::Xapian), and as soon as I add a stopper into the mix, I get a segmentation fault. Here is a short script to demonstrate: use strict; use Search::Xapian qw(:standard); my $qp = new Search::Xapian::QueryParser(); $qp->set_stopper(new Search::Xapian::SimpleStopper('the')); my $q = $qp->parse_query(join(' ', @ARGV)); print $q->get_description, "\n\n"; Now, running something like this causes a segfault: perl testsearch.pl the problem Comment out the set_stopper line and it works ok. I'm using: Debian Linux Perl 5.8.6 Xapian 0.9.10 Search::Xapian 0.9.10.0 Is this a known problem? Thanks, Mark
Olly Betts
2007-Mar-19 13:56 UTC
[Xapian-discuss] QueryParser + Stopper broken? (at least from Perl)
On Sat, Mar 17, 2007 at 10:52:46PM -0700, Mark Blythe wrote:> This is my first day experimenting with Xapian, and it was working > quite well until I tried using a stopper. I'm using the Perl bindings > (Search::Xapian), and as soon as I add a stopper into the mix, I get a > segmentation fault. Here is a short script to demonstrate:It looks like perl is garbage collecting the SimpleStopper class from under our feet. You can workaround this by changing the set_stopper line to: my $stopper = new Search::Xapian::SimpleStopper('the'); $qp->set_stopper($stopper); I'll look at how best to fix this properly. Cheers, Olly