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

Re: (ITS#8582) LMDB lockfile/mutex arch dependency

hyc@openldap.org wrote:
> Full_Name: Howard Chu
> Version: HEAD
> OS: Linux
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (
> Submitted by: hyc
> I ran into some corruption problems when running a 64bit LMDB process concurrent
> with a 32bit one using MDB_VL32. While LMDB's own structures are all 64bit clean
> in a VL32 build, unfortunately pthread_mutex_t structures are not. In
> particular, in glibc a pthread_mutex_t can be one of 3 different sizes - 24
> bytes for 32bit runtime on 32bit processor, 32 bytes for 32bit runtime on
> x86-64, and 40 bytes for 64bit runtime on x86-64. As such, we cannot safely
> share an LMDB environment between 32 and 64bit Linux processes, even when using
> MDB_VL32.
> This problem doesn't affect Windows, platforms using SysV semaphores, or
> platforms using POSIX named semaphores. I don't currently know whether this is a
> problem on other platforms that support POSIX process-shared mutexes.

For glibc, I've submitted an enhancement request regarding mutex sizes:


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