[Xapian-discuss] Segfault with php bindings
Olly Betts
olly at survex.com
Mon Mar 31 02:10:59 BST 2008
On Sun, Mar 30, 2008 at 08:46:43PM +0100, Robert Young wrote:
> I'm getting a segfault with the term generator when using a stemmer
> and a stopper at the same time with the PHP bindings as shown in the
> linked code.
The use of the stemmer is irrelevant - the bug is that Xapian::Stopper
isn't currently reference counted in C++ (because our reference counting
mechanism doesn't work with classes which users can subclass). So you
currently need to ensure that PHP keeps a reference to the Stopper by
hand (e.g. assign it to a global variable).
We're hoping to fix this for 1.1.0. Richard has a solution which works
for C++, but hasn't managed to get SWIG to wrap it correctly yet.
If that can't be got to work, I think we may need to look at getting the
proxy class to hold onto the Stopper via a PHP member variable, and
similarly for other languages.
Cheers,
Olly
More information about the Xapian-discuss
mailing list