[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: (ITS#8420) lmdb Windows sizeof(off_t) == sizeof(int32_t)
- To: openldap-its@OpenLDAP.org
- Subject: Re: (ITS#8420) lmdb Windows sizeof(off_t) == sizeof(int32_t)
- From: hyc@symas.com
- Date: Wed, 11 May 2016 02:39:50 +0000
- Auto-submitted: auto-generated (OpenLDAP-ITS)
clayton.stangeland@gmail.com wrote:
> Full_Name: Clayton Stangeland
> Version: lmdb master a04aad31c2
> OS: Windows 7 64 bit
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (170.54.58.5)
>
>
> This is an lmdb bug.
I see no bug here. We fixed this back in January in commit
20dec1f69bf4860202c764ce92b1fbbe3d11a065
>
> mdb_page_flush fails as database size nears 2 GB on Windows. The reason is off_t
> == int32_t on Windows. So the off_t pos variable becomes negative and this
> section of code in mdb_page_flush enters the error condition as ov.OffsetHigh is
> also negative:
>
> ov.Offset = pos & 0xffffffff;
> ov.OffsetHigh = pos >> 16 >> 16;
> if (!WriteFile(env->me_fd, dp, size, NULL, &ov)) {
> rc = ErrCode();
> DPRINTF(("WriteFile: %d", rc));
> return rc;
> }
>
> Adding23dedefine off_t int64_t in an #ifdef _WIN32 region solves this.
>
>
>
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/