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

Re: (ITS#7896) macos issue with mdb_env_map



zxcvbn4038@gmail.com wrote:
> Full_Name: CJS
> Version: 0.9.14
> OS: MacOS 10.9.4
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (66.6.34.253)
>
>
> Under MacOS I have compiled lmdb 0.9.14, and I've found that anything using it
> reports resources unavailable the second time they try to use a database - this
> includes the test scripts. Make test output ends with:

Thanks for the report, fixed now in mdb.master
>
> key: 0x10ead7e7c 199 , data: 0x10ead7e80 199 409 foo bar
> mdb_env_open failed, error 16 Resource busy
> make: *** [test] Error 1
>
> I tracked down the problem to mdb.c, mdb_env_map function, line 3714.
>
>          /* Can happen because the address argument to mmap() is just a
>           * hint.  mmap() can pick another, e.g. if the range is in use.
>           * The MAP_FIXED flag would prevent that, but then mmap could
>           * instead unmap existing pages to make room for the new map.
>           */
>          if (addr && env->me_map != addr)
>                  return EBUSY;   /* TODO: Make a new MDB_* error code? */
>
> This expression always evaluates to true when opening an existing database, even
> with mdb_env_open is called without the MDB_FIXEDMAP flag, so the open always
> fails.
>
> If I commend that check out and rerun make test, it succeeds:
>
> key: 0x103580f84 240 , data: 0x103580f88 240 576 foo bar
> Status of Main DB
>    Tree depth: 2
>    Branch pages: 1
>    Leaf pages: 3
>    Overflow pages: 0
>    Entries: 92
>
> My guess is that this is macos related or someone would have found it before me.
>
>
> Git blame shows this portion of the code hasn't changed in almost a year.
> However other parts of the same function have changed within the last year, so
> this could be a result of a recent change.
>
>
>


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