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

"failed: unexpected type" assert failure in ConnectionGraph::split_unique_types() with unsafe accesses

    Details

    • Subcomponent:
    • Resolved In Build:
      b10

      Backports

        Description

        # Internal Error (/home/roland/hs/src/hotspot/share/opto/escape.cpp:3118), pid=17688, tid=17701
        # assert(tn_type == TypePtr::NULL_PTR || tn_t != __null && !tinst->klass()->is_subtype_of(tn_t->klass())) failed: unexpected type
        #
        # JRE version: OpenJDK Runtime Environment (13.0) (fastdebug build 13-internal+0-adhoc.roland.hs)
        # Java VM: OpenJDK 64-Bit Server VM (fastdebug 13-internal+0-adhoc.roland.hs, compiled mode, sharing, compressed oops, g1 gc, linux-amd64)
        # Problematic frame:
        # V [libjvm.so+0xb8ee95] ConnectionGraph::split_unique_types(GrowableArray<Node*>&, GrowableArray<ArrayCopyNode*>&)+0x405

        Test case:

        import java.lang.reflect.Field;
        import jdk.internal.misc.Unsafe;

        public class MaybeOffHeapUnsafeAccessToNewObject {
            public volatile int f_int = -1;


            public static Unsafe unsafe = Unsafe.getUnsafe();
            public static final long f_int_off;

            static {
                Field f_int_field = null;
                try {
                    f_int_field = MaybeOffHeapUnsafeAccessToNewObject.class.getField("f_int");
                } catch (Exception e) {
                    System.out.println("reflection failed " + e);
                    e.printStackTrace();
                }
                f_int_off = unsafe.objectFieldOffset(f_int_field);
            }

            static public void main(String[] args) {
        MaybeOffHeapUnsafeAccessToNewObject o = new MaybeOffHeapUnsafeAccessToNewObject();
        test1();
            }

            static Object test1_helper1(Object t) {
        return t;
            }

            static long test1_helper2(long off) {
        return off;
            }

            static int test1() {
                MaybeOffHeapUnsafeAccessToNewObject t = new MaybeOffHeapUnsafeAccessToNewObject();
        Object o = test1_helper1(t);
        long off = test1_helper2(f_int_off);
                return unsafe.getInt(o, off);
            }

        }

        ran with:

        -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation -Xcomp -XX:CompileOnly=MaybeOffHeapUnsafeAccessToNewObject::test1 -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline MaybeOffHeapUnsafeAccessToNewObject

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  roland Roland Westrelin
                  Reporter:
                  roland Roland Westrelin
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: