serkan-ozal / jillegal

Java Off Heap Object Pool and On the Fly Instrumentation Tool
http://serkan-ozal.github.com/jillegal/
111 stars 13 forks source link

Various errors when accessing ComplexTypeArrayOffHeapPool #6

Open glebreutov opened 7 years ago

glebreutov commented 7 years ago

Hi, After previous issue, I made some tests and now I getting other mysterious errors.

At each run I'm randomly getting or exception

Exception in thread "main" java.lang.AbstractMethodError: tr.com.serkanozal.jillegal.offheap.pool.impl.ComplexTypeArrayOffHeapPool.getAt(I)Ljava/lang/Object;
    at impl.jilligal.HashVO.getVoarrayElt(Unknown Source)
    at impl.jilligal.HashVO.get_node(Unknown Source)
    at impl.jilligal.HashVO.long_value(Unknown Source)
    at samples.OneMillionObjects.readRandomValues(OneMillionObjects.java:48)
    at samples.OneMillionObjects.main(OneMillionObjects.java:128)

or JVM crash

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000000102d93e10, pid=28283, tid=5891
#
# JRE version: Java(TM) SE Runtime Environment (8.0_20-b05) (build 1.8.0_20-ea-b05)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.20-b05 mixed mode bsd-amd64 )
# Problematic frame:
# V  [libjvm.dylib+0x393e10]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/glebreutov/TreeStruct/hs_err_pid28283.log
Compiled method (c1)   20119 1946       3       impl.jilligal.HashVO::getVoarrayElt (12 bytes)
 total in heap  [0x0000000103b9bf90,0x0000000103b9c468] = 1240
 relocation     [0x0000000103b9c0b0,0x0000000103b9c0f8] = 72
 main code      [0x0000000103b9c100,0x0000000103b9c2e0] = 480
 stub code      [0x0000000103b9c2e0,0x0000000103b9c388] = 168
 oops           [0x0000000103b9c388,0x0000000103b9c390] = 8
 metadata       [0x0000000103b9c390,0x0000000103b9c3b8] = 40
 scopes data    [0x0000000103b9c3b8,0x0000000103b9c3e8] = 48
 scopes pcs     [0x0000000103b9c3e8,0x0000000103b9c448] = 96
 dependencies   [0x0000000103b9c448,0x0000000103b9c458] = 16
 nul chk table  [0x0000000103b9c458,0x0000000103b9c468] = 16
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#

Code that causes crash:

Getting object:

        hash_pool =
                offHeapService.createOffHeapPool(
                        new ObjectOffHeapPoolCreateParameterBuilder<HashVO>().
                                type(HashVO.class).
                                objectCount(10).
                                referenceType(ObjectPoolReferenceType.EAGER_REFERENCED).
                                build());
                HashVO hashVO = hash_pool.get();
                //hashVO.init(desired_element_count);
                hashVO.setArrayWrapper(offHeapService.createOffHeapPool(
                        new ArrayOffHeapPoolCreateParameterBuilder<HashVONode>().
                                type(HashVONode.class).
                                length(desired_element_count).
                                initializeElements(false).
                                build()));

                hashVO.setNodePool(offHeapService.createOffHeapPool(
                        new ObjectOffHeapPoolCreateParameterBuilder<HashVONode>().
                                type(HashVONode.class).
                                objectCount(desired_element_count).
                                referenceType(ObjectPoolReferenceType.EAGER_REFERENCED).
                                build()));

HashVO source can be found here: https://github.com/glebreutov/jilligal-test/blob/master/src/impl/jilligal/HashVO.java

Here you can find whole source of test https://github.com/glebreutov/jilligal-test/blob/master/src/samples/OneMillionObjects.java

Please tell if you need some additional info. Thanks in advance.

glebreutov commented 7 years ago

Forget to add important note: everything works fine if I allocate HashVo on heap