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

[lworld] Reflection fails with assert(layout_helper_is_flatArray(lh)) failed: correct kind

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • repo-valhalla
    • repo-valhalla
    • hotspot

      # Internal Error (/oracle/valhalla/open/src/hotspot/share/oops/flatArrayKlass.cpp:171), pid=823255, tid=823258
      # assert(layout_helper_is_flatArray(lh)) failed: correct kind

      Current thread (0x00007f9ae002a000): JavaThread "main" [_thread_in_vm, id=823258, stack(0x00007f9ae4248000,0x00007f9ae4349000)]

      Stack: [0x00007f9ae4248000,0x00007f9ae4349000], sp=0x00007f9ae4346dc0, free space=1019k
      Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0xb10154] FlatArrayKlass::array_layout_helper(InlineKlass*)+0xc4
      V [libjvm.so+0xb103a3] FlatArrayKlass::FlatArrayKlass(Klass*, Symbol*)+0x83
      V [libjvm.so+0xb108a4] FlatArrayKlass::allocate_klass(Klass*, Thread*)+0x284
      V [libjvm.so+0xd62023] InlineKlass::array_klass_impl(bool, int, Thread*)+0x313
      V [libjvm.so+0xb109f2] FlatArrayKlass::allocate_klass(Klass*, Thread*)+0x3d2
      V [libjvm.so+0xd62023] InlineKlass::array_klass_impl(bool, int, Thread*)+0x313
      V [libjvm.so+0x17bf36f] SystemDictionary::resolve_array_class_or_null(Symbol*, Handle, Handle, Thread*)+0x2cf
      V [libjvm.so+0x17bf54d] SystemDictionary::resolve_or_fail(Symbol*, Handle, Handle, bool, Thread*)+0x1d
      V [libjvm.so+0x16b833a] SignatureStream::as_java_mirror(Handle, Handle, SignatureStream::FailureMode, Thread*)+0x7a
      V [libjvm.so+0x160eb71] get_parameter_types(methodHandle const&, int, oop*, Thread*)+0x161
      V [libjvm.so+0x160f25b] Reflection::new_method(methodHandle const&, bool, Thread*)+0xfb
      V [libjvm.so+0xfa7a62] get_class_declared_methods_helper(JNIEnv_*, _jclass*, unsigned char, bool, Klass*, Thread*) [clone .constprop.0]+0x852
      V [libjvm.so+0xfa83d2] JVM_GetClassDeclaredMethods+0xd2
      j java.lang.Class.getDeclaredMethods0(Z)[Ljava/lang/reflect/Method;+0 java.base
      j java.lang.Class.privateGetDeclaredMethods(Z)[Ljava/lang/reflect/Method;+34 java.base
      j java.lang.Class.getMethodsRecursive(Ljava/lang/String;[Ljava/lang/Class;Z)Ljava/lang/PublicMethods$MethodList;+2 java.base
      j java.lang.Class.getMethod0(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;+14 java.base
      j java.lang.Class.getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;+26 java.base
      j sun.launcher.LauncherHelper.validateMainClass(Ljava/lang/Class;)V+16 java.base
      j sun.launcher.LauncherHelper.checkAndLoadMain(ZILjava/lang/String;)Ljava/lang/Class;+80 java.base
      v ~StubRoutines::call_stub
      V [libjvm.so+0xdced09] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x529
      V [libjvm.so+0xf159f5] jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) [clone .isra.0] [clone .constprop.1]+0x3e5
      V [libjvm.so+0xf18543] jni_CallStaticObjectMethod+0x213
      C [libjli.so+0x45f1] JavaMain+0x8a1
      C [libjli.so+0x7759] ThreadJavaMain+0x9

      Test case:

      --- a/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestArrays.java
      +++ b/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestArrays.java
      @@ -3013,4 +3013,36 @@ public class TestArrays extends InlineTypeTest {
                   // expected
               }
           }
      +
      + // Empty inline type array access
      + @Test()
      + public MyValueEmpty test130(MyValueEmpty[] array) {
      + array[0] = new MyValueEmpty();
      + return array[1];
      + }
      +
      + @DontCompile
      + public void test130_verifier(boolean warmup) {
      + MyValueEmpty[] array = new MyValueEmpty[2];
      + MyValueEmpty empty = test130(array);
      + Asserts.assertEquals(empty, MyValueEmpty.default);
      + }
      +
      + static inline class EmptyContainer {
      + MyValueEmpty empty = MyValueEmpty.default;
      + }
      +
      + // Empty inline type container array access
      + @Test()
      + public MyValueEmpty test131(EmptyContainer[] array) {
      + array[0] = new EmptyContainer();
      + return array[1].empty;
      + }
      +
      + @DontCompile
      + public void test131_verifier(boolean warmup) {
      + EmptyContainer[] array = new EmptyContainer[2];
      + MyValueEmpty empty = test131(array);
      + Asserts.assertEquals(empty, MyValueEmpty.default);
      + }
       }

            thartmann Tobias Hartmann
            thartmann Tobias Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: