You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know this is for an old version 0.7.0 and many things have changed but bear with me.
I'm planning to upgrade to the latest version but that requires code changes so for now I'm stuck and I would like to clarify this.
I have a test that crashes JVM with SIGSEGV on Ubuntu 16, arch is amd64
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~16.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
Test configures lmdb with a following
maxReaders=2
other flags: MDB_NORDAHEAD, MDB_NOMEMINIT, MDB_NOTLS, MDB_NOSYNC, MDB_NOMETASYNC
The test executes various searches using 20 threads.
Soon after starting the test it crashes with below stacktrace killing JVM
The test was written purely to get the idea how library would behave under that circumstances.
First of all I was under the impression that LMDB would check limits and fail with an error as described here #65
Second, I have a protection in place using Java's Semaphore to acquire and release when transactions are in use to avoid the problem.
It seems this is now working as expected, since the crash happens anyway, this is something I need to investigate.
Relevant code looks as follows
TxRead txnRead() {
try {
boolean acquired;
if (_readerAwaitTime == 0L)
acquired = _readSemaphore.tryAcquire();
else
acquired = _readSemaphore.tryAcquire(_readerAwaitTime, TimeUnit.MILLISECONDS);
if (!acquired)
throw new TimeoutRuntimeException("Timeout when waiting for read transaction");
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
// semaphore acquired
try {
return new TxRead(_env.txnRead(), _readSemaphore);
} catch (Exception e) {
_readSemaphore.release();
throw e;
}
}
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f905c639d44, pid=32565, tid=0x00007f903c10e700
#
# JRE version: OpenJDK Runtime Environment (8.0_292-b10) (build 1.8.0_292-8u292-b10-0ubuntu1~16.04.1-b10)
# Java VM: OpenJDK 64-Bit Server VM (25.292-b10 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libpthread.so.0+0x9d44] pthread_mutex_lock+0x4
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
I know this is for an old version 0.7.0 and many things have changed but bear with me.
I'm planning to upgrade to the latest version but that requires code changes so for now I'm stuck and I would like to clarify this.
I have a test that crashes JVM with SIGSEGV on Ubuntu 16, arch is amd64
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~16.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
Test configures lmdb with a following
The test executes various searches using 20 threads.
Soon after starting the test it crashes with below stacktrace killing JVM
The test was written purely to get the idea how library would behave under that circumstances.
First of all I was under the impression that LMDB would check limits and fail with an error as described here
#65
Second, I have a protection in place using Java's Semaphore to acquire and release when transactions are in use to avoid the problem.
It seems this is now working as expected, since the crash happens anyway, this is something I need to investigate.
Relevant code looks as follows
And client code
TxRead looks as follows
Fatal error
Stacktrace
Any pointers why the crash happens instead of an error would be greatly appreciated
Thanks
Daniel
The text was updated successfully, but these errors were encountered: