Just a heads up in case somebody else is struggling with the same issue.
After a recent upgrade I've started seeing crashes in LMDB, they looked like this
#0 0x00007fad06517cfc in mdb_cursor_put () from /usr/local/lib/libbyzon.so
#1 0x00007fad0651af53 in mdb_put () from /usr/local/lib/libbyzon.so
#2 0x00007fad06506698 in set_value_with_flags (self=<optimized out>, db=<optimized out>, key=...,
value=..., flags=<optimized out>)
at /home/grank/.cargo/registry/src/github.com-1ecc6299db9ec823/lmdb-rs-0.7.2/src/core.rs:1069
#3 set_value (self=<optimized out>, db=<optimized out>, key=..., value=...)
at /home/grank/.cargo/registry/src/github.com-1ecc6299db9ec823/lmdb-rs-0.7.2/src/core.rs:1061
#4 set (self=<optimized out>, db=2, key=..., value=...)
at /home/grank/.cargo/registry/src/github.com-1ecc6299db9ec823/lmdb-rs-0.7.2/src/core.rs:1079
#5 lmdb_rs::core::{{impl}}::set (self=<optimized out>, key=..., value=...)
at /home/grank/.cargo/registry/src/github.com-1ecc6299db9ec823/lmdb-rs-0.7.2/src/core.rs:414
and only happened in the release builds. I've tried a couple of things, like adding global locks around LMDB operations and such, I've upgraded LMDB, but to no avail.
Finally I've lovered the optimization level in order to better debug the issue and voila, the problem vanished.
My conjecture is that LMDB is normally tested with -O2 optimization (cf), but the Rust package uses -O3 (cf), the level which is not supported by the LMDB code base and triggers some kind of a bug.