[Xapian-discuss] Perl make test fails on threads in rhel5

Olly Betts olly at survex.com
Thu Nov 8 15:23:49 GMT 2007


On Thu, Nov 08, 2007 at 03:03:30PM +0000, Tim Brody wrote:
> I've never used gdb/valgrind properly ... so let me know if there's 
> something else to ask them:

You did well then!

> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1208514880 (LWP 4054)]
> 0x005354f4 in Xapian::ValueIterator::operator* (this=0x8a448e8)
>    at api/omvalueiterator.cc:45
> 45      }
> 
> (gdb) backtrace
> #0  0x004514f4 in Xapian::ValueIterator::operator* (this=0x93aa8e8)
>    at api/omvalueiterator.cc:45
> #1  0x00ee7f69 in XS_Search__Xapian__ValueIterator_get_value (
>    my_perl=0x91da008, cv=0x936b190) at XS/ValueIterator.xs:47

Oh right, I realise what's going on here.  I actually stumbled across
this issue while writing the test, but I didn't think things through
enough.  Sorry for being dense.

When a document is read from a database, we don't actually read the
value, terms, or document data until they are first asked for or
modified.

There's a bug in Xapian 1.0.4 and earlier where values_begin() doesn't
ensure that the values have been read.  However both values_end() and
values_count() do, so in real world code this is really unlikely to
be an issue (and indeed nobody reported it despite it being like that
for years).

I spotted this when the new test failed for me, but xapian-core 1.0.4
was already released when I was preparing the Search::Xapian release
so the fix to xapian-core isn't in the release and this test is still
failing.

Either just ignore the test failure, or if you want the tests to pass
patch it by removing the "ok()" from around the first $valueit line and
decrement the number of tests after "plan tests" near the start of the
file.

Cheers,
    Olly



More information about the Xapian-discuss mailing list