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

Incorrect control in LibraryCallKit::inline_native_notify_jvmti_funcs

XMLWordPrintable

    • b17

        Running into the following assert while testing some changes

        # Internal Error (/home/albatem/ws/jdk/open/src/hotspot/share/opto/loopnode.cpp:5523), pid=2082704, tid=2082731
        # assert(!in->is_CFG()) failed: CFG Node with no controlling input?

        Current CompileTask:
        C2: 1878 2115 4 java.lang.VirtualThread$VThreadContinuation$1::run (12 bytes)

        Stack: [0x00007fde6d5f1000,0x00007fde6d6f1000], sp=0x00007fde6d6ebd30, free space=1003k
        Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0x12970c6] PhaseIdealLoop::build_loop_early(VectorSet&, Node_List&, Node_Stack&)+0x766 (loopnode.cpp:5523)
        V [libjvm.so+0x12a2d10] PhaseIdealLoop::build_and_optimize()+0x5b0 (loopnode.cpp:4446)
        V [libjvm.so+0x9f0209] PhaseIdealLoop::optimize(PhaseIterGVN&, LoopOptsMode)+0x3b9 (loopnode.hpp:1110)
        V [libjvm.so+0x9eb1c0] Compile::Optimize()+0x820 (compile.cpp:2307)
        V [libjvm.so+0x9eefd0] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1bb0 (compile.cpp:854)
        V [libjvm.so+0x849feb] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x13b (c2compiler.cpp:119)
        V [libjvm.so+0x9faf40] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x980 (compileBroker.cpp:2285)
        V [libjvm.so+0x9fbd78] CompileBroker::compiler_thread_loop()+0x5f8 (compileBroker.cpp:1946)
        V [libjvm.so+0xeb784c] JavaThread::thread_main_inner()+0xcc (javaThread.cpp:720)
        V [libjvm.so+0x17a2fea] Thread::call_run()+0xba (thread.cpp:220)
        V [libjvm.so+0x14a1bda] thread_native_entry(Thread*)+0x12a (os_linux.cpp:785)

        The issue is duplicated by editing src/java.base/share/classes/java/lang/VirtualThread.java and remove @ChangesCurrentThread from the run(Runnable) method. This annotation is not needed on this method as it doesn't change the current thread.

        With that change, run Skynet like this:

        cd test/jdk/java/lang/Thread/virtual/stress
        java -XX:NativeMemoryTracking=summary -XX:FlightRecorderOptions=preserve-repository=false -XX:StartFlightRecording=dumponexit=true,settings=profile Skynet.java 100

        The assert goes away if the method is changed to have DontInline so this is something to do with the inlining of run(Runnable) into its caller.

              thartmann Tobias Hartmann
              alanb Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: