Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8153540

C2 intrinsic for Unsafe.allocateInstance doesn't properly filter out array classes



      While testing Graal we tripped across an assertion failure with C2.

      # A fatal error has been detected by the Java Runtime Environment:
      # Internal Error (/slave/buildlog/binary-jdk9-fastdebug-OJNGraalJDK9_ssw_amd64_linux/build/hotspot/src/share/vm/oops/klass.hpp:316), pid=30394, tid=30395
      # assert(lh > (jint)_lh_neutral_value) failed: must be instance
      # JRE version: OpenJDK Runtime Environment (9.0) (fastdebug build 9-internal+0-2016-03-25-125435..build)
      # Java VM: OpenJDK 64-Bit Server VM (fastdebug 9-internal+0-2016-03-25-125435..build, mixed mode, tiered, jvmci, compressed oops, g1 gc, linux-amd64)
      # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %P" (or dumping to /slave/buildlog/CI-graal-core_gate_amd64_linux_postgate_jdk9-SNAPSHOT-fastdebug_jdk8_jdk7/build/graal-core/core.30394)
      # If you would like to submit a bug report, please visit:
      # http://bugreport.java.com/bugreport/crash.jsp

      --------------- S U M M A R Y ------------

      Command Line: -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=graal -Xbootclasspath/p:/slave/buildlog/CI-graal-core_gate_amd64_linux_postgate_jdk9-SNAPSHOT-fastdebug_jdk8_jdk7/build/truffle/mxbuild/dists/truffle-api.jar:/slave/buildlog/CI-graal-core_gate_amd64_linux_postgate_jdk9-SNAPSHOT-fastdebug_jdk8_jdk7/build/graal-core/mxbuild/dists/graal.jar -esa -ea -Djava.awt.headless=true com.oracle.mxtool.junit.MxJUnitWrapper -JUnitVerbose -JUnitFailFast -JUnitEnableTiming -JUnitEagerStackTrace @/tmp/mxtoolc1shvd.testclasses

      Host: ce9e05124607, Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz, 8 cores, 15G, Ubuntu 14.04.3 LTS
      Time: Fri Apr 1 11:14:47 2016 UTC elapsed time: 33 seconds (0d 0h 0m 33s)

      --------------- T H R E A D ---------------

      Current thread (0x00007fc15801b800): JavaThread "main" [_thread_in_vm, id=30395, stack(0x00007fc1619c2000,0x00007fc161ac3000)]

      Stack: [0x00007fc1619c2000,0x00007fc161ac3000], sp=0x00007fc161abf2d0, free space=1012k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x119f775] VMError::report(outputStream*, bool)+0xfb3
      V [libjvm.so+0x11a1522] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x498
      V [libjvm.so+0x11a0fda] VMError::report_and_die(Thread*, char const*, int, char const*, char const*, __va_list_tag*)+0x7e
      V [libjvm.so+0x917b49] report_vm_error(char const*, int, char const*, char const*, ...)+0x105
      V [libjvm.so+0x5a9b4b] Klass::layout_helper_needs_slow_path(int)+0x45
      V [libjvm.so+0x1038446] OptoRuntime::new_instance_C(Klass*, JavaThread*)+0x18e
      v ~RuntimeStub::_new_instance_Java
      J 3490 C2 sun.misc.Unsafe.allocateInstance(Ljava/lang/Class;)Ljava/lang/Object; (8 bytes) @ 0x00007fc14cd1a9d8 [0x00007fc14cd1a900+0x00000000000000d8]
      j com.oracle.graal.jtt.jdk.UnsafeAllocateInstance01.testClassForException(Ljava/lang/Class;)V+4
      v ~StubRoutines::call_stub


          Issue Links



              • Assignee:
                vlivanov Vladimir Ivanov
                never Tom Rodriguez
              • Votes:
                0 Vote for this issue
                5 Start watching this issue


                • Created: