Greetings,

OpenJDK (7 and 8) HotSpot JVM SIGSEGVs on FreeBSD 11 as soon as node joins a topology and starts to communicate via DirectNioClientWorker. The root cause is DirectByteBufferStreamImpl (both versions) which uses GridUnsafe.getXXX/putXXX(Object object, offset, value) methods to manipulate DirectByteBuffer, whereas it should really be using GridUnsafe.getXXX/putXXX(address, value), since DirectByteBuffer is allocated on C heap (off java heap). Notice that at least one instance of the same problem is known to exist in another project using Unsafe https://issues.apache.org/jira/browse/CASSANDRA-8325 .
The OpenJDK source of Unsafe is more or less clear on this
http://hg.openjdk.java.net/jdk8u/jdk8u60/jdk/file/935758609767/src/share/classes/sun/misc/Unsafe.java#l391
I have prepared a simple fix here https://github.com/apache/ignite/compare/1.9.0-rc2...kimec:freebsd-support . However, I am not sure if the solution is right in regard to overall ignite performance. I've tried to compile ignite-core with tests and after applying my changes was able to pass all the basic stuff until the performance test stage at which point my machine run out of RAM and swap space (some 10 GB)... Not sure if this is how the tests are supposed to be. After compiling with -DskipTests I was able to create FreeBSD 11 - CentOS 7 two node cluster and everything seemed OK (the two nodes shared an IGFS instance backed by replicated caches). Please note that OpenJDK on different systems as well as Oracle JDK (via Linux compatility layer) on FreeBSD seem to be more forgiving and does not SIGSEGV. I've based my branch on 1.9.0-rc2 since tag 1.9.0 has already POM with version 2.0.

Kamil


Reply via email to