Issue 8622 - Getting MDB_CORRUPTED when deleting within a DUPSORT database
Summary: Getting MDB_CORRUPTED when deleting within a DUPSORT database
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-22 14:04 UTC by Hallvard Furuseth
Modified: 2017-06-01 22:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Hallvard Furuseth 2017-03-22 14:04:11 UTC
Full_Name: Hallvard B Furuseth
Version: LMDB_0.9.19, mdb.master
OS: Linux x86_64
URL: http://www.openldap.org/lists/openldap-technical/201703/msg00043.html
Submission from: (NULL) (193.157.240.142)
Submitted by: hallvard


This is Klaus Malorny's test case from openldap-technical (linked
below).  Compiled with gcc -std=gnu99.  Breaks mdv.master and mdb.RE:
....
33000000 records written
testing
mdb_cursor_get: unexpected error -30796: MDB_CORRUPTED: Located page was wrong
type

In LMDB 0.9.18, the test case instead asserted:
mdb.c:5647: Assertion 'mc->mc_flags & C_INITIALIZED' failed in
mdb_cursor_next()

That was fixed by commit b46fc3e438d8085d5e5fc7d558c0002ee1e2753c
"ITS#8406 fix xcursors after cursor_del".

Then it broke again at 6b1df0e4c7fadd21d1233d7157229b2d89ccaa04 "More
for ITS#8406 (xcursor fixups)", giving the MDB_CORRUPTED.
Comment 1 Quanah Gibson-Mount 2017-03-22 15:04:38 UTC
moved from Incoming to Software Bugs
Comment 2 Hallvard Furuseth 2017-03-22 19:00:34 UTC
I wrote:
> URL: http://www.openldap.org/lists/openldap-technical/201703/msg00043.html

malloc (sizeof (KeyDataType) * recordCount); in the test program should be
calloc (recordCount, sizeof (KeyDataType)); to avoid writing uninit'ed data.

And the test can be a lot smaller and faster:

static long size = 50000000;
static int recordCount = 600000;
static int majorIdCount = 2500;
static int minorIdCount = 5000;


Comment 3 Howard Chu 2017-03-23 21:28:06 UTC
h.b.furuseth@usit.uio.no wrote:
> I wrote:
>> URL: http://www.openldap.org/lists/openldap-technical/201703/msg00043.html
>
> malloc (sizeof (KeyDataType) * recordCount); in the test program should be
> calloc (recordCount, sizeof (KeyDataType)); to avoid writing uninit'ed data.
>
> And the test can be a lot smaller and faster:
>
> static long size = 50000000;
> static int recordCount = 600000;
> static int majorIdCount = 2500;
> static int minorIdCount = 5000;

Fixed now in git.


-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 4 Howard Chu 2017-03-23 21:28:50 UTC
changed notes
changed state Open to Test
Comment 5 OpenLDAP project 2017-06-01 17:10:15 UTC
fixed in mdb.master, mdb.RE/0.9 (0.9.21)
Comment 6 Quanah Gibson-Mount 2017-06-01 17:10:15 UTC
changed notes
changed state Test to Release
Comment 7 Quanah Gibson-Mount 2017-06-01 22:10:30 UTC
changed state Release to Closed