I have an environment with one database:
alecm@db0 /fusionio1/lmdb> mdb_stat -fear dbgraph-to-compress/vx_to_edg
Environment Info
Map address: (nil)
Map size: 1200000000000
Page size: 4096
Max pages: 292968750
Number of pages used: 24631912
Last transaction ID: 69821
Max readers: 126
Number of readers used: 0
Reader Table Status
(no active readers)
Freelist Status
Tree depth: 2
Branch pages: 1
Leaf pages: 13
Overflow pages: 26338
Entries: 1801
Free pages: 13028375
Status of Main DB
Tree depth: 1
Branch pages: 0
Leaf pages: 1
Overflow pages: 0
Entries: 1
Status of vx_to_edg
Tree depth: 4
Branch pages: 45690
Leaf pages: 7845337
Overflow pages: 0
Entries: 3993304504
I compressed it (i.e. got rid of Free Pages) with
mdb_copy -c dbgraph-to-compress/vx_to_edg/ dbgraph-compressed/vx_to_edg
This command exited normaly with return status 0.
After executing mdb_stat -a on the compressed database I got SIGSEGV
alecm@db0 /fusionio1/lmdb> gdb --args mdb_stat -fear dbgraph-compressed/vx_to_edg
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.3) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from mdb_stat...done.
(gdb) r
Starting program: /usr/local/bin/mdb_stat -fear dbgraph-compressed/vx_to_edg
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Environment Info
Map address: (nil)
Map size: 1200000000000
Page size: 4096
Max pages: 292968750
Number of pages used: 11577185
Last transaction ID: 1
Max readers: 126
Number of readers used: 0
Reader Table Status
(no active readers)
Freelist Status
Tree depth: 0
Branch pages: 0
Leaf pages: 0
Overflow pages: 0
Entries: 0
Free pages: 0
Status of Main DB
Tree depth: 1
Branch pages: 0
Leaf pages: 1
Overflow pages: 0
Entries: 1
Program received signal SIGSEGV, Segmentation fault.
mdb_xcursor_init1 (node=node@entry=0x7ee891ecdfc4, mc=0x6154a0, mc=0x6154a0) at mdb.c:8556
8556 mx->mx_cursor.mc_flags &= C_SUB|C_ORIG_RDONLY|C_WRITEMAP;
(gdb) bt
#0 mdb_xcursor_init1 (node=node@entry=0x7ee891ecdfc4, mc=0x6154a0, mc=0x6154a0) at mdb.c:8556
#1 0x0000000000405f10 in mdb_cursor_first (mc=0x6154a0, key=0x7fffffffe400, data=0x0) at mdb.c:7279
#2 0x00000000004060fc in mdb_cursor_next (mc=<optimized out>, key=<optimized out>, data=<optimized out>, op=<optimized out>) at mdb.c:6886
#3 0x0000000000404e35 in mdb_cursor_get (mc=0x6154a0, key=key@entry=0x7fffffffe400, data=data@entry=0x0, op=op@entry=MDB_NEXT_NODUP) at mdb.c:7466
#4 0x000000000040222f in main (argc=<optimized out>, argv=<optimized out>) at mdb_stat.c:230
(gdb)
#mdb_copy -V
LMDB 0.9.70: (December 19, 2015)
Linux db0 3.13.0-95-generic
XFS filesystem
Alec Matusis wrote:
I have an environment with one database:
#mdb_copy -V
LMDB 0.9.70: (December 19, 2015)
This is not an actual LMDB version, it's the generic number assigned to the mdb.master development branch. You'll have to be more specific (commit ID). And understand that since you're running a dev branch, it's likely to be unstable at various points.
Linux db0 3.13.0-95-generic
XFS filesystem
You'll have to be more specific (commit ID). And understand that since
you're running a dev branch, it's likely to be unstable at various points. # git log
commit 52bc29ee2efccf09c650598635cd42a50b6ecffe Author: Howard Chu hyc@openldap.org Date: Thu Feb 11 11:34:57 2021 +0000
ITS#9461 fix typo
I repeated the same mdb_stat -a operation on a different Ubuntu system on the same database file (copied the uncompactified data.mdb there, then removed Free pages with mdb_copy -c ), using its stock lmdb-tools that I installed with apt install lmdb-tools, but got the same Segmentation fault:
alecm@bigram:/fusionio1/lmdb/db.0.2.1$ mdb_copy -c /fusionio1/lmdb/db.0.2.1/dbgraph/vx_to_edg_to_compress /fusionio1/lmdb/db.0.2.1/dbgraph/vx_to_edg alecm@bigram:/fusionio1/lmdb/db.0.2.1$ mdb_stat -fear /fusionio1/lmdb/db.0.2.1/dbgraph/vx_to_edg
Environment Info
Map address: (nil)
Map size: 1200000000000
Page size: 4096
Max pages: 292968750
Number of pages used: 11577185
Last transaction ID: 1
Max readers: 126
Number of readers used: 0
Reader Table Status
(no active readers)
Freelist Status
Tree depth: 0
Branch pages: 0
Leaf pages: 0
Overflow pages: 0
Entries: 0
Free pages: 0
Status of Main DB
Tree depth: 1
Branch pages: 0
Leaf pages: 1
Overflow pages: 0
Entries: 1
Segmentation fault (core dumped)
# mdb_stat -V
LMDB 0.9.21: (June 1, 2017)
# apt install lmdb-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
lmdb-utils is already the newest version (0.9.21-1ubuntu0.1).
Ubuntu 18.04.3 LTS Linux bigram 4.15.0-91-generic Ext4 fs
-----Original Message----- From: Howard Chu [mailto:hyc@symas.com] Sent: Monday, March 15, 2021 6:00 AM To: Alec Matusis matusis@matusis.com; openldap-technical@openldap.org Subject: Re: Segmentation fault from mdb_stat -a after successful mdb_copy -c
Alec Matusis wrote:
I have an environment with one database:
#mdb_copy -V
LMDB 0.9.70: (December 19, 2015)
This is not an actual LMDB version, it's the generic number assigned to the mdb.master development branch. You'll have to be more specific (commit ID). And understand that since you're running a dev branch, it's likely to be unstable at various points.
Linux db0 3.13.0-95-generic
XFS filesystem
-- -- Howard Chu CTO, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc/ Chief Architect, OpenLDAP http://www.openldap.org/project/
openldap-technical@openldap.org