[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Antw: Re: LMDB test assertion failures on Linux/MIPS



Howard Chu wrote:
Martin Lucina wrote:
Ulrich.Windl@rz.uni-regensburg.de said:
Hi!

I think a problem with your test program is that you don't wait for the write() thread to finish before you try to read the mmap(). See how locking on a producer-consumer (or reader-writer) relationship is usually implemented (If you don't have it ready, I could send you the algorithms).

That shoudln't matter.

More to the point, you don't wait for the write() thread to *start* - there's
no guarantee that it will actually start running as soon as the barrier is
released. A valid test has to know that the write() thread actually got
scheduled and ran.

   The write thread opens the file descriptor with
O_DSYNC, and all the test program is trying to verify is that the mmap
eventually becomes consistent.  You can ignore the pthread_barrier stuff,
that just tries to eliminate thread creation time from the equation.

Apparently Linux on MIPS requires explicit cache control, see the cacheflush(2) manpage. This has been added to mdb.master and it appears that LMDB test programs are no longer crashing.

--
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/