From markus@greenrobot.de Sun Mar 4 13:56:38 2018 From: markus@greenrobot.de To: openldap-bugs@openldap.org Subject: Re: (ITS#8777) [LMDB] Closing read cursor uses already freed transaction (MDB_VL32) Date: Sun, 04 Mar 2018 13:56:36 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0390018033563443760==" --===============0390018033563443760== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit --001a114db4265d5f2405669693c3 Content-Type: text/plain; charset="UTF-8" Because of another MDB_VL32 issue ( http://www.openldap.org/its/index.cgi?findid=8813), I would like to come back the MDB_SIZE64 patch suggested here. I understand that you have no intention to merge this in. For us, applying the patch makes perfectly sense nevertheless: It fixes a severe problem and the 2 GB limit on 32 bits is fine for our use case. Do you see any side effects the proposed patch might have? I'm aware you cannot give guarantees, but a simple "should work" from your side would be appreciated! Thanks! Markus I'd like to propose a different approach to 64 bits on 32 bit CPUs; > something like this: > [...] > lmdb.h > @@ -187,7 +187,15 @@ > # define MDB_FMT_Z "z" /**< printf/scanf format > modifier for size_t */ > #endif > > -#ifndef MDB_VL32 > +#if defined(MDB_VL32) && defined(MDB_SIZE64) > +#error either define MDB_VL32 OR MDB_SIZE64 > +#endif > +#ifdef MDB_SIZE64 > +typedef uint64_t mdb_size_t; > +# define MDB_SIZE_MAX SIZE_MAX /**< max #mdb_size_t */ > +# define MDB_PRIy(t) PRI##t##64 > +# define MDB_SCNy(t) SCN##t##64 > +#elif !defined(MDB_VL32)) > /** Unsigned type used for mapsize, entry counts and page/transaction IDs. > * > * It is normally size_t, hence the name. Defining MDB_VL32 makes it > --001a114db4265d5f2405669693c3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Because of another=C2=A0MDB_VL32 issue (http://www.openlda= p.org/its/index.cgi?findid=3D8813), I would like to come back the=C2=A0= MDB_SIZE64 patch sugges= ted=C2=A0here.

I understand that you have no int= ention to merge this in. For us, applying the patch makes perfectly sense n= evertheless: It fixes a severe problem and the 2 GB limit on 32 bits is fin= e for our use case.=C2=A0

Do you see any side effects the proposed p= atch might have? I'm aware you cannot give guarantees, but a simple &qu= ot;should work" from your side would be appreciated!

Thanks!
M= arkus


I'd like to propose a different approach to 64 bit= s on 32 bit CPUs;
something like this:
[...]
lmdb.h
@@ -187,7 +187,15 @@
=C2=A0# define MDB_FMT_Z=C2=A0 =C2=A0 =C2=A0"z"=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/**< printf/s= canf format modifier for size_t */
=C2=A0#endif

-#ifndef MDB_VL32
+#if defined(MDB_VL32) && defined(MDB_SIZE64)
+#error either define MDB_VL32 OR MDB_SIZE64
+#endif
+#ifdef MDB_SIZE64
+typedef uint64_t=C2=A0 =C2=A0 =C2=A0 =C2=A0mdb_size_t;
+# define MDB_SIZE_MAX=C2=A0 SIZE_MAX=C2=A0 =C2=A0 =C2=A0 =C2=A0 /**< ma= x #mdb_size_t */
+# define MDB_PRIy(t)=C2=A0 =C2=A0PRI##t##64
+# define MDB_SCNy(t)=C2=A0 =C2=A0SCN##t##64
+#elif !defined(MDB_VL32))
=C2=A0/** Unsigned type used for mapsize, entry counts and page/transaction= IDs.
=C2=A0 *
=C2=A0 *=C2=A0 =C2=A0 =C2=A0It is normally size_t, hence the name. Defining= MDB_VL32 makes it

--001a114db4265d5f2405669693c3-- --===============0390018033563443760==--