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