[Xapian-devel] some stranges SIGSEGV

Olly Betts olly at survex.com
Sat Jun 14 12:05:42 BST 2014


On Fri, Jun 13, 2014 at 11:22:02PM +0800, Hurricane Tong wrote:
> Now without VALGRIND, there are only 3 failed tests.
> One is cursordelbug1, 
> in brass_dbcheck.cc, Line 187, 
> if (!unpack_uint(&pos, end, &did)) 
> It operates the raw chunk string directly, but as I change the format,
> it will fail for sure.
> Need I to repair all such operations to raw chunk string? 

This code is checking the integrity of the database, so it needs to be
able to unpack your new chunk format.  Ideally the code for unpacking
for checking the database and the code for unpack it for reading it
would live in the same place (and also the code which handles
compaction), but currently that isn't the case.

> And there are some strange SIGSEGV errors when it comes to tests
> doclenaftercommit1 and replacedoc2.
> hurricanetong at hurricanetong-VirtualBox:~/xapian-1.3/xapian-core/tests$
> VALGRIND= ./runtest ./apitest -b brass replacedoc2
> Running tests with backend "brass"...
> Running test: replacedoc2... SIGSEGV at 0xd5d5d5d9
> ./apitest backend brass: 0 tests passed, 1 failed.
> But when I run this test in gdb,
> hurricanetong at hurricanetong-VirtualBox:~/xapian-1.3/xapian-core/tests$
> VALGRIND= ./runtest gdb ./apitest -b brass replacedoc2
> (gdb) r
> Running tests with backend "brass"...
> /home/hurricanetong/xapian-1.3/xapian-core/tests/apitest backend brass:
> All 1 tests passed.
> doclenaftercommit1 is the same.
> What should I do to deal with this strange situation?

Something must be slightly different when running under gdb, which
causes the problem not to manifest.

I'd suggest you run the tests under valgrind, and fix any problems that
valgrind reports.  There's a good chance that will deal with this
problem too.

Cheers,
    Olly



More information about the Xapian-devel mailing list