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

[lworld] runtime/valhalla/inlinetypes/InlineTypeArray.java crashes with " memory leak: allocating without ResourceMark"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: hotspot
    • Labels:

      Description

      This is a pre-testing of lworld merged with JEP 416 (which will be promoted in jdk-18+22): https://github.com/mlchung/valhalla/tree/jep416

      runtime/valhalla/inlinetypes/InlineTypeArray.java fails with allocating without ResourceMark. This test passes when running with -Djdk.reflect.useDirectMethodHandle=false. InlineTypeArray test fails when invoked via method handle.

      # Internal Error (/Users/mlchung/ws/valhalla/valhalla/open/src/hotspot/share/memory/resourceArea.cpp:53), pid=63893, tid=24067
      # fatal error: memory leak: allocating without ResourceMark

      Stack: [0x0000700005be9000,0x0000700005ce9000], sp=0x0000700005ce7a70, free space=1018k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.dylib+0x11b5f29] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x6e9
      V [libjvm.dylib+0x60b111] report_fatal(VMErrorType, char const*, int, char const*, ...)+0x1a1
      V [libjvm.dylib+0xf9afa5] ResourceArea::verify_has_resource_mark()+0x45
      V [libjvm.dylib+0xf8823b] ResourceArea::allocate_bytes(unsigned long, AllocFailStrategy::AllocFailEnum)+0x1b
      V [libjvm.dylib+0x109a1a4] Symbol::as_klass_external_name() const+0x24
      V [libjvm.dylib+0x33707e] BarrierSet::throw_array_null_pointer_store_exception(arrayOop, arrayOop, JavaThread*)+0x14e
      V [libjvm.dylib+0xe74c1d] void ModRefBarrierSet::AccessBarrier<60055654ull, G1BarrierSet>::oop_arraycopy_in_heap<narrowOop>(arrayOop, unsigned long, narrowOop*, arrayOop, unsigned long, narrowOop*, unsigned long)+0x5ed
      V [libjvm.dylib+0xe737cf] void AccessInternal::PostRuntimeDispatch<G1BarrierSet::AccessBarrier<60055654ull, G1BarrierSet>, (AccessInternal::BarrierType)8, 60055654ull>::oop_access_barrier<HeapWordImpl*>(arrayOop, unsigned long, HeapWordImpl**, arrayOop, unsigned long, HeapWordImpl**, unsigned long)+0x7f
      V [libjvm.dylib+0xe733da] std::__1::enable_if<!(HasDecorator<60055622ull, AS_RAW>::value), void>::type AccessInternal::PreRuntimeDispatch::arraycopy<60055622ull, HeapWordImpl*>(arrayOop, unsigned long, HeapWordImpl**, arrayOop, unsigned long, HeapWordImpl**, unsigned long)+0xca
      V [libjvm.dylib+0xe686e7] ArrayAccess<58720256ull>::oop_arraycopy(arrayOop, unsigned long, arrayOop, unsigned long, unsigned long)+0x147
      V [libjvm.dylib+0xe67f85] ObjArrayKlass::do_copy(arrayOop, unsigned long, arrayOop, unsigned long, int, JavaThread*)+0x755
      V [libjvm.dylib+0xe6982f] ObjArrayKlass::copy_array(arrayOop, int, arrayOop, int, int, JavaThread*)+0xecf
      V [libjvm.dylib+0xa20e27] JVM_ArrayCopy+0x347
      J 57 java.lang.System.arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V java.base@18-internal (0 bytes) @ 0x00000001259ddd79 [0x00000001259ddc60+0x0000000000000119]
      j runtime.valhalla.inlinetypes.InlineTypeArray.testComposition()V+195
      j runtime.valhalla.inlinetypes.InlineTypeArray.run()V+21
      j runtime.valhalla.inlinetypes.InlineTypeArray.main([Ljava/lang/String;)V+9
      j java.lang.invoke.LambdaForm$DMH+0x0000000800002000.invokeStatic(Ljava/lang/Object;Ljava/lang/Object;)V+10 java.base@18-internal
      j java.lang.invoke.LambdaForm$MH+0x0000000800005c00.invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+33 java.base@18-internal
      j java.lang.invoke.LambdaForm$MH+0x0000000800006000.invokeExact_MT(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+20 java.base@18-internal
      j jdk.internal.reflect.DirectMethodHandleAccessor.invokeImpl(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+55 java.base@18-internal
      j jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+23 java.base@18-internal
      j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+102 java.base@18-internal
      j com.sun.javatest.regtest.agent.MainWrapper$MainThread.run()V+172

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dsimms David Simms
              Reporter:
              mchung Mandy Chung
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: