gh-185 Add protection for closed env by at055612 · Pull Request #186 · lmdbjava/lmdbjava
@benalexau If I run the test classes in isolation they work fine but when run via mvn test I see
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f4ec41f6a15, pid=22462, tid=22468
#
# JRE version: OpenJDK Runtime Environment (15.0.2+7) (build 15.0.2+7-27)
# Java VM: OpenJDK 64-Bit Server VM (15.0.2+7-27, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C [libpthread.so.0+0x9a15] __pthread_mutex_lock_full+0x335
My suspicion (with zero c knowledge) is that the various tests that are closing the env while txns/cursors/dbis are open are leaving things (i.e. mutex locks) in an untidy state that are then causing later tests to fail. Does this seem right and is there any way to get around this?
An alternative approach would be for the Env to keep a track of open txns/cursors and either prevent closure of the env if any are open or force closure of the open txns/cursors. Such an approach would add overhead though.