https://bugs.openldap.org/show_bug.cgi?id=10396
Issue ID: 10396 Summary: LMDB: another issue with sorted duplicate DBs and cursor delete Product: LMDB Version: 0.9.19 Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: liblmdb Assignee: bugs@openldap.org Reporter: hyc@openldap.org Target Milestone: ---
In mdb_cursor_del0, in the second "Adjust other cursors" section (after mdb_rebalance was called), in these lines
if (m3->mc_xcursor && !(m3->mc_flags & C_EOF)) { MDB_node *node = NODEPTR(m3->mc_pg[m3->mc_top], m3->mc_ki[m3->mc_top]);
The node being referenced should be using mc->mc_top, not m3->mc_top. Most of the time these will be identical, but sometimes due to rebalancing, the mc cursor may be popped below its stack top when calling here.
This bug was introduced for ITS#8406 in commit 37081325f7356587c5e6ce4c1f36c3b303fa718c on 2016-04-18.
https://bugs.openldap.org/show_bug.cgi?id=10396
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |TEST
--- Comment #1 from Howard Chu hyc@openldap.org --- Fixed in git mdb.master e13f05211f8c0869fe1475cd632ba59d4f957656 etc...
https://bugs.openldap.org/show_bug.cgi?id=10396
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Keywords|needs_review | Target Milestone|--- |0.9.34 Resolution|TEST |--- Status|RESOLVED |CONFIRMED
https://bugs.openldap.org/show_bug.cgi?id=10396
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CONFIRMED |RESOLVED Resolution|--- |TEST
--- Comment #2 from Quanah Gibson-Mount quanah@openldap.org --- mdb.master:
Commits: e13f0521 by Howard Chu at 2025-10-06T16:49:25+01:00 ITS#10396 lmdb: fix mdb_cursor_del0 with multiple DUPSORT cursors
RE0.9:
Commits: c47b1136 by Howard Chu at 2025-10-06T16:52:32+01:00 ITS#10396 lmdb: fix mdb_cursor_del0 with multiple DUPSORT cursors
https://bugs.openldap.org/show_bug.cgi?id=10396
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |VERIFIED Resolution|TEST |FIXED
https://bugs.openldap.org/show_bug.cgi?id=10396
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |akyrtzi@gmail.com
--- Comment #3 from Howard Chu hyc@openldap.org --- *** Issue 8406 has been marked as a duplicate of this issue. ***