Re: uncaught C++ exception from Perl Search::Xapian XS?
Eric Wong <[email protected]> Tue, 28 Mar 2023 02:42:55 +0000
| Newsgroups | gmane.comp.search.xapian.general |
|---|---|
| Message-ID | <20230328024256.M29618@dcvr> |
Olly Betts <[email protected]> wrote: > On Mon, Mar 27, 2023 at 11:46:04AM +0000, Eric Wong wrote: > > I'm using Search::Xapian XS from Debian stable and I'm getting what > > appears to be an unwrapped C++ exception: > > > > terminate called after throwing an instance of 'Xapian::DatabaseModifiedError' > > > > Using `eval' from Perl5 doesn't seem effective in catching it. > > > > I'm using postlist_begin, postlist_end and ++ to iterate a > > PositionIterator, and reading XS/*Iterator.xs, I see the XS > > wrappers are missing: > > FWIW, postlist_begin gives you a PostingIterator (positionlist_begin > would give you a PositionIterator). Erm, yes. I was sleepy :x > > 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). Is there a git repo for Search::Xapian? Or I can just generate patches via tarball retrieved from `apt-get source libsearch-xapian-perl`. > This is unlikely to be something that we can fix in a debian stable > release (because it doesn't seem to fit Debian's release critical bug > definition), so you'll need to build your own bindings rather than using > the package from debian stable. Understood. I'm also working around it by forking off (yet another) process atm so the error gets contained.