Here is the patch I got from SleepyCat:
Hi, Kevin, Keith Bostic here. I believe the appended patch
will make Berkeley DB run correctly on your Mac OS X system.
Please let us know if you have any further problems.
Regards,
--keith
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Keith Bostic
Sleepycat Software Inc. bostic@sleepycat.com
118 Tower Rd. +1-781-259-3139
Lincoln, MA 01773 http://www.sleepycat.com
*** dbinc/mutex.h.orig Wed Apr 10 14:50:05 2002
--- dbinc/mutex.h Wed Dec 31 19:00:00 1969
***************
*** 510,532 ****
* 'set' mutexes have the value 1, like on Intel; the returned value
from
* MUTEX_SET() is 1 if the mutex previously had its low bit clear, 0
otherwise.
*/
! #define MUTEX_SET(tsl) ({ \
! int __one = 1; \
! int __r; \
! tsl_t *__l = (tsl); \
! asm volatile (" \
! 0: \
! lwarx %0,0,%1; \
! cmpwi %0,0; \
! bne 1f; \
! stwcx. %2,0,%1; \
! bne- 0b; \
! 1:" \
! : "=&r" (__r) \
! : "r" (__l), "r" (__one)); \
! !(__r & 1); \
! })
!
#define MUTEX_UNSET(tsl) (*(tsl) = 0)
#define MUTEX_INIT(tsl) MUTEX_UNSET(tsl)
#endif
--- 510,536 ----
* 'set' mutexes have the value 1, like on Intel; the returned value
from
* MUTEX_SET() is 1 if the mutex previously had its low bit clear, 0
otherwise.
*/
! extern int __db_mutex_set __P((volatile tsl_t *));
! static void
! __db_mutex_tas_dummy()
! {
! __asm__ __volatile__(" \n\
! .globl ___db_mutex_set \n\
! ___db_mutex_set: \n\
! lwarx r5,0,r3 \n\
! cmpwi r5,0 \n\
! bne fail \n\
! addi r5,r5,1 \n\
! stwcx. r5,0,r3 \n\
! beq success \n\
! fail: \n\
! li r3,0 \n\
! blr \n\
! success: \n\
! li r3,1 \n\
! blr");
! }
! #define MUTEX_SET(tsl) __db_mutex_set(tsl)
#define MUTEX_UNSET(tsl) (*(tsl) = 0)
#define MUTEX_INIT(tsl) MUTEX_UNSET(tsl)
#endif
On Monday, October 14, 2002, at 05:24 AM, Nicholas Riley wrote:
> On Sun, Oct 13, 2002 at 08:29:09PM -0400, Kevin D. Bond wrote:
>> Please note that there is a bug with MUTEXs in Berkeley DB 4.0 under
>> Mac OS X. In fact I had problems with everything from 3.3 to 4.0.
>> 4.1
>> includes a fix, you can get the mutex change from 4.1 and include it
>> in
>> 4.0. If unfixed, this bug will cause database corruption during
>> concurrent writes to the database.
>
> This explains why I can't run a Subversion server on OS X for more
> than about 5 commits before the database explodes. I've spent days
> trying to track down this problem already, but didn't get anywhere
> (probably because I was looking inside Subversion instead of BDB for
> the problem).
>
> Do you have a patch for 4.0.14 to fix the mutex problems? If so I can
> test it out... I've got plenty of test cases - for example, all I need
> to do is create a new repository, import a dumpfile, and I get errors
> with the version I'm using.
>
> --
> =Nicholas Riley <njriley@uiuc.edu> |
> <http://www.uiuc.edu/ph/www/njriley>
> Pablo Research Group, Department of Computer Science and
> Medical Scholars Program, University of Illinois at Urbana-Champaign
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Oct 14 16:40:45 2002