VM asserts with "assert(false) failed: Possible safepoint reached by thread that does not allow it" when running with -XX:+ExitOnFullCodeCache

XMLWordPrintable

      VM asserts with "assert(false) failed: Possible safepoint reached by thread that does not allow it" when running with -XX:+ExitOnFullCodeCache.

      To force the exit condition, run a hello world program or any other java program with -XX:NonNMethodCodeHeapSize=500M -XX:ReservedCodeCacheSize=512008K -XX:+ExitOnFullCodeCache. On exploded builds, no program is needed, instead using -version is sufficient. This reproduces all the way back to JDK9 when segmented code caches were introduced.

      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (src/hotspot/share/runtime/javaThread.cpp:374), pid=547140, tid=547156
      # assert(false) failed: Possible safepoint reached by thread that does not allow it
      #
      # JRE version: Java(TM) SE Runtime Environment (27.0) (fastdebug build 27-internal-mhassig.open)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 27-internal-mhassig.open, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x1123968] JavaThread::check_possible_safepoint() [clone .part.0]+0x28

      Current CompileTask:
      C1:73 9 3 java.lang.StringLatin1::charAt (15 bytes)

      Stack: [0x00007fc210d1b000,0x00007fc210e1b000], sp=0x00007fc210e18910, free space=1014k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x1123968] JavaThread::check_possible_safepoint() [clone .part.0]+0x28 (javaThread.cpp:374)
      V [libjvm.so+0x1125c74] JavaThread::check_for_valid_safepoint_state()+0x94 (javaThread.cpp:374)
      V [libjvm.so+0x1752f01] Mutex::lock()+0x41 (mutex.cpp:119)
      V [libjvm.so+0x10e4fb0] before_exit(JavaThread*, bool)+0x40 (mutexLocker.hpp:204)
      V [libjvm.so+0xbc1301] CompileBroker::handle_full_code_cache(CodeBlobType)+0x261 (compileBroker.cpp:2476)
      V [libjvm.so+0xb59a9e] CodeCache::allocate(unsigned int, CodeBlobType, bool, CodeBlobType)+0x28e (codeCache.cpp:548)
      V [libjvm.so+0x1771954] nmethod::new_nmethod(methodHandle const&, int, int, CodeOffsets*, int, DebugInformationRecorder*, Dependencies*, CodeBuffer*, int, OopMapSet*, ExceptionHandlerTable*, ImplicitExceptionTable*, AbstractCompiler*, CompLevel, char*, int, JVMCINMethodData*)+0x1e4 (nmethod.cpp:1644)
      V [libjvm.so+0xa5b6cd] ciEnv::register_method(ciMethod*, int, CodeOffsets*, int, CodeBuffer*, int, OopMapSet*, ExceptionHandlerTable*, ImplicitExceptionTable*, AbstractCompiler*, bool, bool, bool, bool, int)+0x37d (ciEnv.cpp:1064)
      V [libjvm.so+0x8916af] Compilation::install_code(int)+0xff (c1_Compilation.cpp:417)
      V [libjvm.so+0x896042] Compilation::compile_method()+0x4c2 (c1_Compilation.cpp:480)
      V [libjvm.so+0x896523] Compilation::Compilation(AbstractCompiler*, ciEnv*, ciMethod*, int, BufferBlob*, bool, DirectiveSet*)+0x363 (c1_Compilation.cpp:600)
      V [libjvm.so+0x897f88] Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x208 (c1_Compiler.cpp:263)
      V [libjvm.so+0xbc1ae0] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x780 (compileBroker.cpp:2345)
      V [libjvm.so+0xbc3340] CompileBroker::compiler_thread_loop()+0x530 (compileBroker.cpp:1989)
      V [libjvm.so+0x1128b9b] JavaThread::thread_main_inner()+0x13b (javaThread.cpp:776)
      V [libjvm.so+0x1bb8b86] Thread::call_run()+0xb6 (thread.cpp:243)
      V [libjvm.so+0x180ccf8] thread_native_entry(Thread*)+0x118 (os_linux.cpp:929)

        1. hs_err.log
          57 kB
          Manuel Hässig

            Assignee:
            Unassigned
            Reporter:
            Daniel Skantz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: