Thanks for making available LMDB. Downloaded LMDB 0.9.15 from clibs github. Is this the latest?
Made some code changes to compile in VC++. Does anyone want?
Robin
--On Sunday, December 20, 2015 9:27 PM -0800 Robin Rowe robin.rowe@cinepaint.org wrote:
Thanks for making available LMDB. Downloaded LMDB 0.9.15 from clibs github. Is this the latest?
No. Latest is 0.9.17.
--Quanah
--
Quanah Gibson-Mount Platform Architect Zimbra, Inc. -------------------- Zimbra :: the leader in open source messaging and collaboration
Robin Rowe wrote:
Thanks for making available LMDB. Downloaded LMDB 0.9.15 from clibs github. Is this the latest?
The latest release is 0.9.17. The official repo is the OpenLDAP repo.
Made some code changes to compile in VC++. Does anyone want?
We don't really support Microsoft tools. You're welcome to submit code patches against the latest code in mdb.master. MSVC Project files and other such stuff will not be accepted, we have no desire to maintain ancillary files for tools that we don't use.
It's pretty trivial to build LMDB using MSVC command line tools and a proper Makefile.
Made some code changes to compile in VC++. Does anyone want?
We don't really support Microsoft tools. You're welcome to submit code patches against the latest code in mdb.master. MSVC Project files and other such stuff will not be accepted, we have no desire to maintain ancillary files for tools that we don't use.
I'd be interested to see those code changes.
Quanah wrote:
Latest is 0.9.17.
Thanks. Where's the howto or link to fetch that?
Howard wrote:
You're welcome to submit code patches against the latest code in mdb.master. MSVC Project files and other such stuff will not be accepted
Ok, thanks. How about cmake? Would you like that?
I created a set of small C++ wrapper classes to make the API easier to use in C++ applications. Would you like that?
Timur wrote:
I'd be interested to see those code changes.
Ok, I'll make a patch after I sync up with 0.9.17 and confirm it still builds on Linux.
For the most part, the code changes I made were adding explicit void* casts, which C++ is more strict about than C. I still have these VC++ warnings (in 0.9.15) that I didn't fix:
1>c:\code\lib\liblmdb\mdb.c(3892): warning C4244: '=' : conversion from 'LONGLONG' to 'size_t', possible loss of data 1>c:\code\lib\liblmdb\mdb.c(4287): warning C4244: 'argument' : conversion from 'mdb_hash_t' to 'unsigned long', possible loss of data 1>c:\code\lib\liblmdb\mdb.c(6458): warning C4146: unary minus operator applied to unsigned type, result still unsigned 1>c:\code\lib\liblmdb\mdb.c(8859): warning C4804: '>>' : unsafe use of type 'bool' in operation 1>c:\code\lib\liblmdb\mdb.c(8860): warning C4804: '>>' : unsafe use of type 'bool' in operation
I can make these warnings go away with casts. Should I? Do any of these seem like they may be bugs?
One bug I noticed, I encountered a segfault when opening a directory that didn't exist and so make this change to mdb.c:
/* For RDONLY, get lockfile after we know datafile exists */ if (!(flags & (MDB_RDONLY|MDB_NOLOCK))) { rc = mdb_env_setup_locks(env, lpath, mode, &excl); #ifndef _MSC_VER if (rc) goto leave; #endif }
The goto skips over allocating to a null pointer that is dereferenced later, thus triggering a null pointer segfault.
Thanks!
Robin
Robin Rowe wrote:
Quanah wrote:
Latest is 0.9.17.
Thanks. Where's the howto or link to fetch that?
The official repo is the OpenLDAP git repo. You can also use the LMDB mirror repo on github. Relevant links are on http://www.openldap.org/
Howard wrote:
You're welcome to submit code patches against the latest code in mdb.master. MSVC Project files and other such stuff will not be accepted
Ok, thanks. How about cmake? Would you like that?
We don't use cmake.
I created a set of small C++ wrapper classes to make the API easier to use in C++ applications. Would you like that?
We don't maintain wrappers, in any language. We leave those to 3rd parties. How are yours different from the existing C++ wrappers?
http://symas.com/mdb/#wrappers
Timur wrote:
I'd be interested to see those code changes.
Ok, I'll make a patch after I sync up with 0.9.17 and confirm it still builds on Linux.
Patches against 0.9.17 won't be accepted, at this point. Please read http://www.openldap.org/devel/ more carefully.
For the most part, the code changes I made were adding explicit void* casts, which C++ is more strict about than C. I still have these VC++ warnings (in 0.9.15) that I didn't fix:
1>c:\code\lib\liblmdb\mdb.c(3892): warning C4244: '=' : conversion from 'LONGLONG' to 'size_t', possible loss of data 1>c:\code\lib\liblmdb\mdb.c(4287): warning C4244: 'argument' : conversion from 'mdb_hash_t' to 'unsigned long', possible loss of data 1>c:\code\lib\liblmdb\mdb.c(6458): warning C4146: unary minus operator applied to unsigned type, result still unsigned 1>c:\code\lib\liblmdb\mdb.c(8859): warning C4804: '>>' : unsafe use of type 'bool' in operation 1>c:\code\lib\liblmdb\mdb.c(8860): warning C4804: '>>' : unsafe use of type 'bool' in operation
I can make these warnings go away with casts. Should I? Do any of these seem like they may be bugs?
We don't investigate old releases. Generally, compiling C code with a C++ compiler is a mistake, since the two languages have subtle differences in integer semantics.
One bug I noticed, I encountered a segfault when opening a directory that didn't exist and so make this change to mdb.c:
/* For RDONLY, get lockfile after we know datafile exists */ if (!(flags & (MDB_RDONLY|MDB_NOLOCK))) { rc = mdb_env_setup_locks(env, lpath, mode, &excl);
#ifndef _MSC_VER if (rc) goto leave; #endif }
This is why we don't waste our time investigating old releases. The code you're referencing has changed since 0.9.15.
The goto skips over allocating to a null pointer that is dereferenced later, thus triggering a null pointer segfault.
If you can reproduce this in current code, please submit an actual bug report with complete stack trace to the ITS.
On 12/25/2015 1:38 PM, Howard Chu wrote:
We don't maintain wrappers, in any language. We leave those to 3rd parties. How are yours different from the existing C++ wrappers?
No exceptions, no Boost, no STL.
Patches against 0.9.17 won't be accepted, at this point. Please read http://www.openldap.org/devel/ more carefully.
Ok, patch against master.
Generally, compiling C code with a C++ compiler is a mistake, since the two languages have subtle differences in integer semantics.
I always thought integers were consistent across C/C++. Which subtle differences do you mean?
Thanks,
Robin