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

RISC-V: JVM crashes on startup when disabling compressed instructions

XMLWordPrintable

    • b24
    • riscv
    • linux

      The reason of the crash is that we will use more space for compiler stubs during stubRoutines generation when compressed instructions is disabled. So we can simply increase the reserved size of compiler stubs for this CPU platform to resolve the issue.

      $ java -XX:-UseRVC -version

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (macroAssembler_riscv.cpp:1962), pid=11972, tid=11987
      # Error: ShouldNotReachHere()
      #
      # JRE version: OpenJDK Runtime Environment (24.0) (build 24-testing-builds.shipilev.net-openjdk-jdk-b2062-20241
      107-2322)
      # Java VM: OpenJDK 64-Bit Server VM (24-testing-builds.shipilev.net-openjdk-jdk-b2062-20241107-2322, mixed mode
      , sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-riscv64)
      # Problematic frame:
      # V [libjvm.so+0x95a8fe] MacroAssembler::target_addr_for_insn(unsigned char*)+0x176
      #
      # Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-cored
      ump %P %u %g %s %t %c %h" (or dumping to /home/fyang/core.11972)
      #
      # 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: -XX:-UseRVC

      Host: RISCV64, 64 cores, 125G, Fedora release 38 (Thirty Eight)
      Time: Fri Nov 8 08:19:44 2024 CST elapsed time: 0.221422 seconds (0d 0h 0m 0s)

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

      Current thread (0x0000003fb01bfd00): JavaThread "C1 CompilerThread0" daemon [_thread_in_vm, id=11987, stack(0x
      0000003f613e6000,0x0000003f615e6000) (2048K)]

      Stack: [0x0000003f613e6000,0x0000003f615e6000], sp=0x0000003f615e3a40, free space=2038k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x95a8fe] MacroAssembler::target_addr_for_insn(unsigned char*)+0x176 (macroAssembler_riscv.cpp:
      1962)
      V [libjvm.so+0xa9e29a] Relocation::pd_call_destination(unsigned char*)+0x28 (macroAssembler_riscv.hpp:458)
      V [libjvm.so+0xa9b912] CallRelocation::fix_relocation_after_move(CodeBuffer const*, CodeBuffer*)+0x4c (reloc
      Info.cpp:370)
      V [libjvm.so+0x48190a] CodeBuffer::relocate_code_to(CodeBuffer*) const+0x1c2 (codeBuffer.cpp:800)
      V [libjvm.so+0x482248] CodeBuffer::copy_code_to(CodeBlob*)+0x12a (codeBuffer.cpp:737)
      V [libjvm.so+0x47ede8] RuntimeStub::new_runtime_stub(char const*, CodeBuffer*, short, int, OopMapSet*, bool,
      bool)+0x136 (codeBuffer.hpp:715)
      V [libjvm.so+0x3dc736] Runtime1::generate_blob(BufferBlob*, C1StubId, char const*, bool, StubAssemblerCodeGen
      Closure*)+0xec (c1_Runtime1.cpp:233)
      V [libjvm.so+0x3dc838] Runtime1::initialize(BufferBlob*)+0x56 (c1_Runtime1.cpp:262)
      V [libjvm.so+0x372526] Compiler::initialize()+0x5c (c1_Compiler.cpp:53)
      V [libjvm.so+0x4af440] CompileBroker::init_compiler_runtime()+0xd2 (compileBroker.cpp:1787)
      V [libjvm.so+0x4b4d68] CompileBroker::compiler_thread_loop()+0xe8 (compileBroker.cpp:1929)
      V [libjvm.so+0x6f2aca] JavaThread::thread_main_inner() [clone .part.0]+0x98 (javaThread.cpp:758)
      V [libjvm.so+0xbf4f14] Thread::call_run()+0x8e (thread.cpp:232)
      V [libjvm.so+0xa1f8dc] thread_native_entry(Thread*)+0xce (os_linux.cpp:858)
      C [libc.so.6+0x7331c] start_thread+0x108

            fyang Fei Yang
            fyang Fei Yang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: