https://bugs.openldap.org/show_bug.cgi?id=10529
--- Comment #8 from christopher@gmerlin.de christopher@gmerlin.de --- You are right, mdb_strerror() would have been more correct. But in this case it makes no difference.
I tested with again with this program against commit 6c1fc84aa979e00f5e505409138a49ceed69ac4f.
as probably expected mdb_get() after the rollback fails with 22(Invalid argument) instead of assertion failure because the dbi handle got invalidated. In my opinion this still es unexpected behaviour because the rollback has the side-effect of invalidating a dbi handle that was opened in another previous transaction.
Trying opening the dbi again fails with the old assertion failure:
Got <blub> on line 56 test: mdb_get(txn, dbi, &k, &v) on line 83 failed with 22 (Invalid argument) Got <(null)> on line 84 openldap-mdb.master3/libraries/liblmdb/mdb.c:7615: Assertion 'root > 1' failed in mdb_page_search()
Program received signal SIGABRT, Aborted. 0x00007ffff7e4995c in ?? () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) bt #0 0x00007ffff7e4995c in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007ffff7df4cc2 in raise () from /lib/x86_64-linux-gnu/libc.so.6 #2 0x00007ffff7ddd4ac in abort () from /lib/x86_64-linux-gnu/libc.so.6 #3 0x000055555555670d in mdb_assert_fail (env=0x55555557a2a0, expr_txt=0x55555557593d "root > 1", func=0x555555575bc0 <__func__.13> "mdb_page_search", file=0x5555555757d8 "openldap-mdb.master3/libraries/liblmdb/mdb.c", line=7615) at openldap-mdb.master3/libraries/liblmdb/mdb.c:1997 #4 0x0000555555561850 in mdb_page_search (mc=0x7fffffffdfd0, key=0x7fffffffe170, flags=0) at openldap-mdb.master3/libraries/liblmdb/mdb.c:7615 #5 0x00005555555632f8 in mdb_cursor_set (mc=0x7fffffffdfd0, key=0x7fffffffe170, data=0x7fffffffe160, op=MDB_SET, exactp=0x7fffffffdf9c) at openldap-mdb.master3/libraries/liblmdb/mdb.c:8149 #6 0x0000555555570b3b in mdb_dbi_open (txn=0x55555557b710, name=0x555555575dc2 "double txn_abort", flags=262152, dbi=0x7fffffffe21c) at openldap-mdb.master3/libraries/liblmdb/mdb.c:12332 #7 0x0000555555573f0a in main () at test.c:91