Paul B. Henson wrote:
On Thu, Aug 03, 2017 at 02:20:29PM -0700, Paul B. Henson wrote:
From my initial look, mdb_env_create() successfully sets mdb->mi_dbenv, it's still valid in mdb_db_open(), but by the time it reaches be->be_entry_put in slapadd() it's NULL :(.
It turned out it was only sometimes NULL. The culprit was actually the local OpenBSD patch that was added to mdb_db_open() to ensure MDB_WRITEMAP is always set:
if ( !(flags & MDB_WRITEMAP) ) { Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(mdb_db_open) ": database \"%s\" does not have writemap. " "This is required on systems without unified buffer cache.\n", be->be_suffix[0].bv_val, rc, 0 ); goto fail; }
There were two problems with it; first, it accesses the local flags variable before it is initialized to mdb->mi_dbenv_flags shortly thereafter, so the value is random and the if block nondeterministically triggers, and second, it doesn't assign a failure value to rc before it jumps to fail:, so the function returns successfully but with a closed be.
mdb has been disabled for a while, so I'm guessing the first issue might have occurred over time as backend.c changed and the patch was just blindly updated without testing. The second issue I'm not sure about.
So much for OpenBSD's vaunted attention to detail.
I temporarily tweaked it to always enable MDB_WRITEMAP
That would be the simplest approach.
so I could run the mdb test suite (which doesn't have it enabled for everything) and so far it seems to be working.
I would hope that this simple issue isn't why they've had it disabled all this time, but I guess I'll see what happens with the full test suite as it progresses.
Nice work, thanks for the update.
From: Howard Chu Sent: Friday, August 4, 2017 4:23 AM
Nice work, thanks for the update.
So 10 of the mdb tests ended up failing; a couple because slapd failed to start, a bunch because ldapadd failed, and one because the script that evidently was executable per the -x test moments before suddenly wasn't found? There doesn't seem to be any log info or other remnants of the tests left over once they are done running to determine why they failed? Unless I missed something; what does one do to check on a test to see why it failed? Thanks…
test020-proxycache: Waiting 5 seconds for slapd to start... Waiting 5 seconds for slapd to start... Waiting 5 seconds for slapd to start...
test049-sync-config: Adding schema and databases on provider... ldapadd failed for database config (80)!
test050-syncrepl-multimaster: Adding schema and databases on server 1... ldapadd failed for database config (80)!
test052-memberof: Running ldapadd to build slapd config database... ldapadd failed (80)!
test057-memberof-refint: Running ldapadd to build slapd config database... ldapadd failed (80)!
test058-syncrepl-asymmetric: Adding database config on central master... ldapadd failed for central master database config (80)!
test059-slave-config: Adding schema and databases on provider... ldapadd failed for database config (80)!
test061-syncreplication-initiation: Adding database configuration on ldap://localhost:9011/ ldapadd failed (80)!
test063-delta-multimaster: Waiting 5 seconds for slapd to start... Waiting 5 seconds for slapd to start...
test064-constraint: /usr/obj/ports/openldap-2.4.44/openldap-2.4.44/tests/scripts/all[91]: /usr/obj/ports/openldap-2.4.44/openldap-2.4.44/tests/scripts/test064-constraint: No such file or directory
openldap-technical@openldap.org