[Xapian-discuss] xapian + plpgsql crash? have backtrace...

rm at fabula.de rm at fabula.de
Sat Oct 30 10:53:14 BST 2004


On Sat, Oct 30, 2004 at 10:40:10AM +0100, Olly Betts wrote:
> On Sat, Oct 30, 2004 at 12:53:24AM -0700, Eric Parusel wrote:
> > Olly Betts wrote:
> > >Is Xapian being used in a threaded way here?  QueryParser currently uses
> > >a few global static objects (because it uses Bison) which means it's
> > >currently not safely reentrant.
> > 
> > Well, I'm not sure what magic pl/perl uses to do it's job, but the 
> > function (shown earlier in this thread) is relatively simple, I think.
> > I've never really tinkered with perl and threads...
> 
> Does it all work if you don't use QueryParser, but instead use something
> like:
> 
>   my $stem = Search::Xapian::Stemmer(q|english|);
>   my $q = Search::Xapian::QueryParser(OP_AND, map {$stem->stem_word($_)} split /\W+/, $query);
>   my $enq = $db->enquire($q);
> 
> If so, that would suggest it is indeed the QueryParser.

Sorry, just a short comment (not really enough time :-(

AFAIK, PostgreSQL doesn't use threads - it has a master/slave-
processes setup (postmaster taking the conection and handing it
to a dedicated backend server process). So there shouldn't be
any threading issues here. BUT: linking a C++ lib into a Perl
interpreter into a C application might be too much here. IIRC 
PostgreSQL uses it's own memory management scheme (kind of a
pooled memory management) and makes heavy use of setjmp/longjump
to handle transactions (i.e. pools are assigned for a transaction
and the pool is cleared during commit/rollback). The thing got
out of an aborted transaction by means of a longjmp the last time
i had a closer look at it (admitedly some time ago). I can't imagine
that C++'s destructor handling et al. will deal nicely with this kind
of code path.
But i might be completely off here ...

 Cheers Ralf Mattes 

> Cheers,

>     Olly
> 
> _______________________________________________
> Xapian-discuss mailing list
> Xapian-discuss at lists.xapian.org
> http://lists.xapian.org/mailman/listinfo/xapian-discuss



More information about the Xapian-discuss mailing list