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

fatal error: memory leak: allocating without ResourceMark

XMLWordPrintable

    • b19

        There are two places in Loom code that call f.oops_interpreted_do() to process oops in the stackChunk. Although not obvious this call seem to require to have a ResourceMark and there are several contexts where these are call where we don't have one:

        STDOUT:
        #
        # A fatal error has been detected by the Java Runtime Environment:
        #
        # Internal Error (open/src/hotspot/share/memory/resourceArea.cpp:66), pid=788653, tid=788679
        # fatal error: memory leak: allocating without ResourceMark
        #
        # JRE version: OpenJDK Runtime Environment (23.0) (fastdebug build 23-internal-2024-04-03-1654274.pchilano...)
        # Java VM: OpenJDK 64-Bit Server VM (fastdebug 23-internal-2024-04-03-1654274.pchilano..., mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
        # Problematic frame:
        # V [libjvm.so+0x15d9e26] ResourceArea::verify_has_resource_mark() [clone .part.0]+0x26
        #
        # Core dump will be written. Default location: open/build/linux-x64/test-support/jtreg_test_jdk_jdk_internal_vm_Continuation_OSRTest_java/scratch/0/core.788653
        #
        # An error report file with more information is saved as:
        # open/build/linux-x64/test-support/jtreg_test_jdk_jdk_internal_vm_Continuation_OSRTest_java/scratch/0/hs_err_pid788653.log
        [6.537s][warning][os] Loading hsdis library failed
        #
        # If you would like to submit a bug report, please visit:
        # https://bugreport.java.com/bugreport/crash.jsp
        #

        Stack: [0x00007f5865a02000,0x00007f5865b02000], sp=0x00007f5865afd380, free space=1004k
        Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0x15d9e26] ResourceArea::verify_has_resource_mark() [clone .part.0]+0x26 (resourceArea.cpp:66)
        V [libjvm.so+0x15da456] (arena.hpp:140)
        V [libjvm.so+0x149626b] InterpreterOopMap::resource_copy(OopMapCacheEntry*)+0xdb (oopMapCache.cpp:440)
        V [libjvm.so+0x149678b] OopMapCache::compute_one_oop_map(methodHandle const&, int, InterpreterOopMap*)+0x7b (oopMapCache.cpp:620)
        V [libjvm.so+0x13c80fa] Method::mask_for(int, InterpreterOopMap*)+0x6a (method.cpp:318)
        V [libjvm.so+0xc0bc7f] frame::oops_interpreted_do(OopClosure*, RegisterMap const*, bool) const+0x42f (frame.cpp:957)
        V [libjvm.so+0x164b73d] void StackChunkFrameStream<(ChunkFrames)1>::iterate_oops<StackChunkVerifyOopsClosure, RegisterMap>(StackChunkVerifyOopsClosure*, RegisterMap const*) const [clon
        e .part.0]+0x6d (stackChunkFrameStream.inline.hpp:360)
        V [libjvm.so+0x1658c57] void stackChunkOopDesc::iterate_stack<(ChunkFrames)1, VerifyStackChunkFrameClosure>(VerifyStackChunkFrameClosure*)+0xa37 (debug.hpp:66)
        V [libjvm.so+0x164dc66] stackChunkOopDesc::verify(unsigned long*, int*, int*, int*)+0x196 (stackChunkOop.inline.hpp:197)
        V [libjvm.so+0xa3d745] Continuation::debug_verify_continuation(oop)+0x1a5 (continuation.cpp:379)
        V [libjvm.so+0xa4374d] verify_continuation(oop) [clone .isra.0]+0x3d (continuationFreezeThaw.cpp:177)
        V [libjvm.so+0xa4de60] freeze_epilog(JavaThread*, ContinuationWrapper&) [clone .isra.0]+0x50 (continuationFreezeThaw.cpp:1536)
        V [libjvm.so+0xa5a404] int freeze_internal<Config<(oop_kind)0, G1BarrierSet> >(JavaThread*, long*)+0x344 (continuationFreezeThaw.cpp:1612)
        V [libjvm.so+0xa5a92b] int freeze<Config<(oop_kind)0, G1BarrierSet> >(JavaThread*, long*)+0x5b (continuationFreezeThaw.cpp:272)
        J 233 jdk.internal.vm.Continuation.doYield()I java.base@23-internal (0 bytes) @ 0x00007f58804f71f5 [0x00007f58804f71a0+0x0000000000000055]

              pchilanomate Patricio Chilano Mateo
              pchilanomate Patricio Chilano Mateo
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: