https://bugs.openldap.org/show_bug.cgi?id=10551
Issue ID: 10551 Summary: mdb_put() returns MDB_PAGE_FULL depending on key-length parity and insertion order Product: LMDB Version: 1.0.0 Hardware: x86_64 OS: Linux Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: liblmdb Assignee: bugs@openldap.org Reporter: adam.req@gmx.de Target Milestone: ---
Created attachment 1175 --> https://bugs.openldap.org/attachment.cgi?id=1175&action=edit insertion order
## Background I am currently getting familiar with LMDB and encountered the following reproducible behavior.
## Tested versions * OpenLDAP LMDB (`master`) * LMDB (`mdb.RE/1.0`)
hint: 0.9.x was okay
## Description A new LMDB environment is created, followed by the creation of two DBIs. The attached key/value pairs are inserted using `mdb_put()` as follows (only the first dbi was used here):
Key: excl. comma, including the terminating null character (`'\0'`) Value: raw byte sequence (number of bytes exactly as shown in the attachment)
Example: GX\c, 100 -> means 4+1(zero)=5 bytes for key, and 100 bytes for value
The final call to `mdb_put()` fails with: MDB_PAGE_FULL: Internal error - page has no more space
## Reproduction The failure is reproducible using the attached key/value sequence in "insertion order" file. The error does not occur if either of the following changes is made (just tested):
* All keys are forced to have the same byte-length parity by appending an additional `0x00` byte where necessary (all keys become either even- or odd-sized). * The last two insertions are swapped.
https://bugs.openldap.org/show_bug.cgi?id=10551
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|needs_review | Target Milestone|--- |1.0.1 Status|UNCONFIRMED |RESOLVED Resolution|--- |TEST Assignee|bugs@openldap.org |hyc@openldap.org
--- Comment #1 from Howard Chu hyc@openldap.org --- Fixed in git 567292b5d4896d558c7f4fffbf711b86432cc15a
https://bugs.openldap.org/show_bug.cgi?id=10551
--- Comment #2 from Howard Chu hyc@openldap.org --- Created attachment 1176 --> https://bugs.openldap.org/attachment.cgi?id=1176&action=edit test program
sample code to process the test data to reproduce the issue
https://bugs.openldap.org/show_bug.cgi?id=10551
--- Comment #3 from Quanah Gibson-Mount quanah@openldap.org --- mdb.master3:
• 567292b5 by Howard Chu at 2026-07-27T16:05:16+01:00 ITS#10551 lmdb: fix mdb_page_split nodesize calculation
mdb.RE/1.0:
• 27b154b7 by Howard Chu at 2026-07-27T16:05:48+01:00 ITS#10551 lmdb: fix mdb_page_split nodesize calculation
https://bugs.openldap.org/show_bug.cgi?id=10551
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|TEST |FIXED Status|RESOLVED |VERIFIED