[Xapian-discuss] Threaded test (in C++) to reproduce our database
problems
Richard Boulton
richard@lemurconsulting.com
Thu, 17 Jun 2004 13:21:34 +0100
Olly Betts wrote:
> OK, I can reproduce this with vanilla 0.8.0, on x86 using 2.4.24. It's
> a 4 CPU box - perhaps that makes a difference, or maybe CVS HEAD fixes
> it. That's my next thing to try.
>
> Incidentally, I'm not seeing "Db block overwritten" at all. Mostly it's
> this:
>
> Writer /tmp/one.db: ERROR=Error reading block 1: got end of file
>
> But I did see this once:
>
> Writer /tmp/two.db: ERROR=Error reading block 3: Interrupted system call
Hmm - interesting. Whenever read or write is being used, the Xapian
code checks for EINTR, and repeats the call if it is returned.
(Otherwise, any application which uses signals at all is liable to
experience random failures of Xapian operations.) Therefore, this
should never be returned to the user. The code in btree.cc does appear
to correctly implement this, so there are a few possibilities:
- MacOSX is using reporting something other than EINTR when a system
call is interrupted, so it's not being caught.
- The compiler's using the wrong value for EINTR, so the code is
catching the wrong error code.
- Something even weirder is happening.
It might be worth running the threaded test in helgrind, to see if that
detects any shared resources being used that we've forgotten about.
I'll try that in a moment.
--
Richard