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

Shenandoah: Shenandoah needs to mark nmethod's metadata



    • gc
    • b15
    • Not verified



        There are a few Shenandoah failures with tools/javac tests, which indicates there are unmarked nmethods on stacks during STW evacuation or concurrent root phase.

        # A fatal error has been detected by the Java Runtime Environment:
        # Internal Error (src/hotspot/share/runtime/sharedRuntime.cpp:1335), pid=28633, tid=6231
        # assert(caller_nm->is_alive() && !caller_nm->is_unloading()) failed: It should be alive
        # JRE version: OpenJDK Runtime Environment (15.0) (slowdebug build 15-internal+0-adhoc.zgu.jdk)
        # Java VM: OpenJDK 64-Bit Server VM (slowdebug 15-internal+0-adhoc.zgu.jdk, mixed mode, tiered, compressed oops, shenandoah gc, linux-amd64)
        # Problematic frame:
        # V [libjvm.so+0xf9ef79] SharedRuntime::resolve_sub_helper(JavaThread*, bool, bool, Thread*)+0x303
        # Core dump will be written. Default location: /home/zgu/ws/jdk/build/linux-x86_64-server-slowdebug/test-support/jtreg_test_langtools_tier1/scratch/1/core.28633
        # If you would like to submit a bug report, please visit:
        # https://bugreport.java.com/bugreport/crash.jsp

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

        Command Line: -Xmx768m -XX:MaxRAMPercentage=6 -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -ea -esa --patch-module=java.base=/home/zgu/ws/jdk/build/linux-x86_64-server-slowdebug/test-support/jtreg_test_langtools_tier1/patches/java.base -Djava.security.policy=file:/home/zgu/ws/jdk/build/linux-x86_64-server-slowdebug/test-support/jtreg_test_langtools_tier1/jtreg.policy com.sun.javatest.regtest.agent.AgentServer -allowSetSecurityManager -port 60943 -timeoutFactor 4.0

        Host: localhost.localdomain, Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz, 8 cores, 30G, Fedora release 30 (Thirty)
        Time: Thu Feb 20 19:58:14 2020 EST elapsed time: 6430 seconds (0d 1h 47m 10s)

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

        Current thread (0x00007fdc7d270800): JavaThread "AgentVMThread" [_thread_in_vm, id=6231, stack(0x00007fdc55ad5000,0x00007fdc55bd6000)]

        Stack: [0x00007fdc55ad5000,0x00007fdc55bd6000], sp=0x00007fdc55bd0e70, free space=1007k
        Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0xf9ef79] SharedRuntime::resolve_sub_helper(JavaThread*, bool, bool, Thread*)+0x303
        V [libjvm.so+0xf9e558] SharedRuntime::resolve_helper(JavaThread*, bool, bool, Thread*)+0x48
        V [libjvm.so+0xfa03e7] SharedRuntime::resolve_virtual_call_C(JavaThread*)+0x14f
        v ~RuntimeStub::resolve_virtual_call
        J 0x00007fdc6c66fd6c

        When a nmethod is on stack for execution, we only need to ensure all objects nmethod seeing are alive (LRB), but also the nmethod's metadata.

        The solution is:
        1) Use nmethod_entry_barrier to mark its metadata concurrently or
        2) Remark thread code roots at final mark pause


          Issue Links



                zgu Zhengyu Gu
                zgu Zhengyu Gu
                0 Vote for this issue
                2 Start watching this issue