uncaught C++ exception from Perl Search::Xapian XS?

Olly Betts olly at survex.com
Tue Mar 28 05:24:46 BST 2023


On Tue, Mar 28, 2023 at 02:42:55AM +0000, Eric Wong wrote:
> Olly Betts <olly at survex.com> wrote:
> > On Mon, Mar 27, 2023 at 11:46:04AM +0000, Eric Wong wrote:
> > >   try { } catch { handle_exception(); }
> > > 
> > > in several places.  Not sure if that's it or if something
> > > else (I know C, but am not remotely fluent in C++).
> > 
> > That is indeed what's missing.
> > 
> > I'm open to clean patches to address issues in Search::Xapian still,
> > but it's probably simplest to use the Perl bindings from
> > xapian-bindings, which do handle exceptions here (the exception handling
> > is generated automatically).
> 
> OK, I'll try to get to it later this week, and I guess I also
> missed the bookworm freeze, too :<
> 
> I can't expect most users to use non-distro packages, though;
> so it'd be great if Debian gets the SWIG Perl bindings (unless I
> missed it).

You haven't - I didn't get around to packaging them yet (sorry, should
have thought to get that done in time for the imminent bookworm
release).

> Is there a git repo for Search::Xapian?  Or I can just generate
> patches via tarball retrieved from `apt-get source libsearch-xapian-perl`.

There is - it's on the svn/1.2 branch of the xapian repo, in the
search-xapian directory:

https://git.xapian.org/?p=xapian;a=tree;f=search-xapian;hb=refs/heads/svn/1.2

(sorry)

The source of the Debian package is a reasonable starting point though
as the commit rate is really low now.

> Understood.  I'm also working around it by forking off (yet
> another) process atm so the error gets contained.

I'm not sure what you're doing here, but if you're wanting to work with
the current package and this is some sort of batch process and you don't
mind blocking writes while it runs, you could open as a WritableDatabase
and then you can't get DatabaseModifiedError.

This isn't feasible if this is being done as part of an interactive
process, as active indexing would prevent it running indefinitely.

Cheers,
    Olly



More information about the Xapian-discuss mailing list